On Thu, Mar 4, 2021 at 3:24 PM Dimaugh Silvestris
<[email protected]> wrote:
>
> On Thu, 4 Mar 2021 at 19:29, Sam Tobin-Hochstadt <[email protected]> wrote:
>>
>> It doesn't print that way because that wouldn't turn back into the original 
>> value when evaluated, since it's quoted.
>
>
> Is there any other way?
> If not, I might consider the possibility of having a struct type for each of 
> those ugens, but as I was saying in my first mail - is that sensible? That 
> would mean declaring ~600 struct types.

I'm not totally sure what you want. The goal of `print` is to print
things in roughly a way that evaluating the printed result would
produce the original value. Thus:

Evaluating '(1 2 3) produces a 3-element list.
Evaluating (sinosc: 1 2) sounds like it produces a structure that you want.

But evaluating '(sinosc: 1 2) produces a 3-element list, not a
structure. Thus, you don't want that as the printed result. That means
that if you want to construct a pair of 0 and that structure, you need
to use `cons` and not `quote`.

If you want something else then you might need to construct the
function provided for `gen:custom-write` directly, instead of using
`make-constructor-style-printer`, but I still don't understand what
you want the result to be.

Sam

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZfBAj7sTP83Ke965r8jXFKiPKNz5jfqv38NiergNHs5w%40mail.gmail.com.

Reply via email to