I recall reading some 6.x code for RacketScript, and in 6.x world pair
was simply a pair of pointers in C structure[1] and `cons` was again a
primitive function that created those C objects[2]. No special
representation in byte-code [all values are opaque to bytecode (except
ints and floats I think)?]. My impression was it didn't do anything
special with it, at-least explicitly. Things can be different now with
Chez.

[1] 
https://github.com/racket/racket/blob/v6.12/racket/src/racket/include/scheme.h#L347
[2] 
https://github.com/racket/racket/blob/v6.12/racket/src/racket/src/list.c#L1050
On Tue, Nov 27, 2018 at 5:24 PM Milo Turner <iital...@gmail.com> wrote:
>
> Hello all,
>
> There's something I have been very curious of lately, about low level aspects 
> of Racket's compiler.
> First of all, I have always considered "cons" to be essentially the same as a 
> struct:
>
> (struct cons [hd tl] #:transparent)
> (define car (procedure-rename cons-hd 'car))
> (define cdr (procedure-rename cons-tl 'cdr))
>
> However I would not be surprised if cons had special treatment in the 
> compiler, runtime, etc.
>
> Is this the case? How frequently does Racket contain special optimizations 
> for cons cells? Does cons have a special representation at runtime or at the 
> bytecode level?
> Thanks.
>
> --
> 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 racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to