2018-03-26 17:58 GMT+02:00 Kevin Forchione <lyss...@gmail.com>:

> In another thread on structs it was confirmed that structs are in essence
> a vector with some fancy bindings associated. But there must be more going
> on, for instance, the definition (struct foo (A B)) creates a function foo
> that when applied does not print like a vector. Is there any documentation
> instructs that does into the details of what they are and are doing under
> the hood?
>

FWIW here is my way of implementing structs in JavaScript. I assume the C
implementation
of structs is similar.

https://github.com/soegaard/urlang/blob/master/compiler-rjs/runtime.rkt#L1730

The most difficult part to implement is structs with supers.

The C implementation is here:

https://github.com/racket/racket/blob/master/racket/src/racket/src/struct.c


/Jens Axel

-- 
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