<iskarian>Is there a way, given a sexp, to get a list of all the symbols that would need to be defined if that sexp were evaluated? ***rt is now known as robin
<maximed>sneek: later tell iskarian: Maybe compile the S-exp to Tree-IL, and search for "toplevel-define" forms? <sneek>Welcome back maximed, you have 1 message! <sneek>maximed, civodul says: re -fexcess-precision=standard, well done! \o/ <tohoyn>I have a cyclic list structure containing elements of the form (singleton xxx) where xxx is arbitrary data (possibly containing other singletons). How can I replace each (singleton xxx) with xxx so that cycles are handled correctly? <leoprikler>do the singletons themselves also contain cyclic structures? <leoprikler>if not, you could simply try a cycle-respecting map <leoprikler>(if you also want to expand inner singletons, then recursively apply it) <tohoyn>leoprikler: we may assume that all cycles point to singletons <leoprikler>I'm not sure if "all cycles point to singletons" is a helpful property here <leoprikler>like, if you have a cycle, what should be the result? <leoprikler>or should it be merged into the larger result in the way that "fringe" would operate? <tohoyn>leoprikler: consider list (singleton (a (b /cycle/))) where /cycle/ points to the whole list <tohoyn>leoprikler: now the list should be transformed to (a (b /cycle2/)) where /cycle2/ points to the whole new list <leoprikler>IIRC the reader has to handle a similar problem, but there those occurrences are already labelled #1# #2#, etc. <tohoyn>leoprikler: can you give a link for reading circular lists? I tried to google but didn't find it. <tohoyn>the following expression causes guile interpreter to hand: '(#1=(1 2 3 #1#)) <iskarian>ah, maximed, I did consider that, but I didn't realize that it made a distinction between references that were satisfied by the sexp itself and those that were external <sneek>iskarian, you have 1 message! <sneek>iskarian, maximed says: Maybe compile the S-exp to Tree-IL, and search for "toplevel-define" forms? ***apteryx_ is now known as apteryx
<iskarian>So it seems like only record types are resolved, not exported variables <drakonis>what would it take to merge a patch for adding #lang? <drakonis>actually, this one's still not cooked up enough