> On Jul 16, 2019, at 10:36 PM, Alex Knauth <alexan...@knauth.org> wrote: > > > >> On Jul 17, 2019, at 12:16 AM, Kevin Forchione <lyss...@gmail.com >> <mailto:lyss...@gmail.com>> wrote: >> >> Hi guys, >> Is there any function in Racket that will return a symbol representation of >> a value’s datatype? We can interrogate them with predicates, but it occurs >> to me that this information must be carried in the object’s syntax >> somewhere… otherwise the syntax->datum wouldn’t work. Of course I may be >> overlooking something :) > > I'm not sure what you mean by "carried in the object's syntax" or why > syntax->datum is relevant. Could you clarify with a concrete example? > > Anyway putting aside the syntax part and only looking at values, the > `describe` [1] package, in particular the `variant` [2] function might be > helpful to you or not depending on what you mean by "datatype”.
Thanks, Alex! That’s exactly what I’m looking for. My remark on syntax->datum. was simply speculation. A better way to put it is: how does variant able to convert a racket value into a symbol representing its datatype? I was thinking that information must be part of the object’s syntax-object, but it doesn’t look like it. Still, variant reports ‘(a . b) as a ‘pair. and that’s amazing. How is it obtaining that information? Kevin -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/87B4031D-DD8A-439F-B954-B94C03002C5F%40gmail.com. For more options, visit https://groups.google.com/d/optout.