> Likewise, I haven't had much luck figuring out how to introspect structures.  
> I can say (object-name strct) to get the name of the struct, but I cannot 
> find any way to answer the questions:
> 
> 
>     - What are the names of your fields?
> 
>     - What are the accessor / mutator functions for your fields? [The actual 
> function, not just the name]

I think the Structure Inspectors 
(http://docs.racket-lang.org/reference/inspectors.html?q=struct%20reflection) 
docs has what you're looking for here.

> If this were a thing then I could create nicer printers for structures such 
> that they labeled their field names or created a representation equivalent to 
> the creation command.
> 
> 
> What about functions?  Is there a way to answer the following questions?:
> 
>      - How many arguments do you require?
>      - How many values do you return?
>      - What is your contract?

You can get the contract attached to a value with `value-contract` - see 
Contract Utilities 
(http://docs.racket-lang.org/reference/contract-utilities.html?q=get-contract)

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