If you want efficient conditionals you probably want a less than-like
operator too I guess.

On Saturday, March 26, 2016, Alexis King <[email protected]> wrote:

> Ok, I’m happy to take a crack at it if you think that’s a good approach.
> I am quite comfortable with C, but I have basically no idea how Racket’s
> internals work, so that’d be the real barrier. I think one of the
> less-technical questions would also just be how to expose this
> information in Racket.
>
> I do think using a number is probably too fragile, but even then, it
> doesn’t matter too much, since somehow there needs to be a known set of
> values for comparisons. Something like (eq? (type-of some-val)
> type:list) needs to be possible, but I’m not sure where type:list should
> go or what it should actually be called.
>
> > On Mar 26, 2016, at 16:01, Jay McCarthy <[email protected]
> <javascript:;>> wrote:
> >
> > We could expose the C virtual machine's type tags and that would be
> > O(1) to a unique number. We could define the number as not being
> > stable across executions of Racket or versions, whichever we like
> > better.
> >
> > If you're uncomfortable with the number, we could combine it with an
> > O(1) hash lookup from the number to a symbol.
> >
> > I think an extension like this is achievable for someone with a
> > cursory knowledge of C. You should do it Alexis.
> >
> > --
> >
> > The numbers are given here in this enum:
> >
> >
> https://github.com/racket/racket/blob/master/racket/src/racket/src/stypes.h
> >
> > The type tag is just called type:
> >
> >
> https://github.com/racket/racket/blob/master/racket/src/racket/include/scheme.h#L326`
> >
> > Jay
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:;>.
> To post to this group, send email to [email protected]
> <javascript:;>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-dev/034504BF-6A0B-4158-B389-4DCA0DED6FFD%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/CAL3TdOMcWCmW_v1yuywK_9q5GnSCVh29zqtO0CVX2t%2BC_ezA%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to