From: Geoffrey K. <ge...@kn...> - 2003-03-22 15:04:10
|
THANK YOU Tim! It worked! That is: (string->symbol (.name$ x)) And to answer your question, c-modules is a list of symbols, not closures, though I could have made a list of closures too. Geoffrey On Saturday, Mar 22, 2003, at 09:51 US/Eastern, Timothy Hickey wrote: > Hi Geoffrey, > How is c-modules defined in your application? > You can access the name of closure, f, (as a string) using > (.name$ f) > So perhaps you could use > (define (name-in-c-module? x) > (member (string->symbol (.name$ x)) c-module)) > > Or, if c-module was a list of closures, then you could just use member > directly. > > Does this help? > ---Tim--- > > > On Saturday, March 22, 2003, at 09:02 AM, Geoffrey Knauth wrote: > >> I have some code that looks like this: >> >> (define (foo-helper for-real module debug) >> ((let (args ((cond ((member? module a-modules) a-decription) >> ((cond ((member? module b-modules) (cons d-ds (list >> a-description))) >> ((cond ((member? module c-modules) (cons t-ds (list >> a-description))) >> [...] >> >> Generally, module is a Closure, which takes 1 or 2 args. >> >> Let's say module is AFUNC (the closure, not the symbol). >> >> > AFUNC >> Closure AFUNC[2] (T_DESCR C_DESCR) >> > (member? AFUNC c-modules) >> #f >> > (member? 'AFUNC c-modules) >> #t >> > c-modules >> (BOOFUNC FOOFUNC ZOOFUNC AFUNC BLAHFUNC ...) >> >> How do I get (member? (<something> module) c-modules) to return #t ? >> >> Thanks, >> Geoffrey >> >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by:Crypto Challenge is now open! Get >> cracking and register here for some mind boggling fun and the chance >> of winning an Apple iPod: >> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en >> _______________________________________________ >> Jscheme-user mailing list >> Jsc...@li... >> https://lists.sourceforge.net/lists/listinfo/jscheme-user >> > |
From: Ken A. <kan...@bb...> - 2003-03-23 22:49:16
|
And you must have defined your own member? procedure. Scheme has member and memq. They do not end in "?" because they are not strictly predicates, they return #f or the sublist containing the matching member. k At 10:04 AM 3/22/2003 -0500, Geoffrey Knauth wrote: >THANK YOU Tim! It worked! That is: (string->symbol (.name$ x)) > >And to answer your question, c-modules is a list of symbols, not closures, though I could have made a list of closures too. > >Geoffrey > >On Saturday, Mar 22, 2003, at 09:51 US/Eastern, Timothy Hickey wrote: > >>Hi Geoffrey, >> How is c-modules defined in your application? >>You can access the name of closure, f, (as a string) using >> (.name$ f) >>So perhaps you could use >> (define (name-in-c-module? x) >> (member (string->symbol (.name$ x)) c-module)) >> >>Or, if c-module was a list of closures, then you could just use member directly. >> >>Does this help? >>---Tim--- >> >> >>On Saturday, March 22, 2003, at 09:02 AM, Geoffrey Knauth wrote: >> >>>I have some code that looks like this: >>> >>>(define (foo-helper for-real module debug) >>> ((let (args ((cond ((member? module a-modules) a-decription) >>> ((cond ((member? module b-modules) (cons d-ds (list a-description))) >>> ((cond ((member? module c-modules) (cons t-ds (list a-description))) >>>[...] >>> >>>Generally, module is a Closure, which takes 1 or 2 args. >>> >>>Let's say module is AFUNC (the closure, not the symbol). >>> >>>> AFUNC >>>Closure AFUNC[2] (T_DESCR C_DESCR) >>>> (member? AFUNC c-modules) >>>#f >>>> (member? 'AFUNC c-modules) >>>#t >>>> c-modules >>>(BOOFUNC FOOFUNC ZOOFUNC AFUNC BLAHFUNC ...) >>> >>>How do I get (member? (<something> module) c-modules) to return #t ? >>> >>>Thanks, >>>Geoffrey >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: >>>http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en >>>_______________________________________________ >>>Jscheme-user mailing list >>>Jsc...@li... >>>https://lists.sourceforge.net/lists/listinfo/jscheme-user > > > >------------------------------------------------------- >This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: >http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |
From: Geoffrey K. <ge...@kn...> - 2003-03-23 22:59:15
|
Yes, silly me, I did define `member?' before I realized you already had `member', which I'll use. Thanks. --Geoffrey On Sunday, Mar 23, 2003, at 17:48 US/Eastern, Ken Anderson wrote: > And you must have defined your own member? procedure. > Scheme has member and memq. They do not end in "?" because they are > not strictly predicates, they return #f or the sublist containing the > matching member. > > k > At 10:04 AM 3/22/2003 -0500, Geoffrey Knauth wrote: >> THANK YOU Tim! It worked! That is: (string->symbol (.name$ x)) >> >> And to answer your question, c-modules is a list of symbols, not >> closures, though I could have made a list of closures too. >> >> Geoffrey >> >> On Saturday, Mar 22, 2003, at 09:51 US/Eastern, Timothy Hickey wrote: >> >>> Hi Geoffrey, >>> How is c-modules defined in your application? >>> You can access the name of closure, f, (as a string) using >>> (.name$ f) >>> So perhaps you could use >>> (define (name-in-c-module? x) >>> (member (string->symbol (.name$ x)) c-module)) >>> >>> Or, if c-module was a list of closures, then you could just use >>> member directly. >>> >>> Does this help? >>> ---Tim--- >>> >>> >>> On Saturday, March 22, 2003, at 09:02 AM, Geoffrey Knauth wrote: >>> >>>> I have some code that looks like this: >>>> >>>> (define (foo-helper for-real module debug) >>>> ((let (args ((cond ((member? module a-modules) >>>> a-decription) >>>> ((cond ((member? module b-modules) (cons >>>> d-ds (list a-description))) >>>> ((cond ((member? module c-modules) (cons >>>> t-ds (list a-description))) >>>> [...] >>>> >>>> Generally, module is a Closure, which takes 1 or 2 args. >>>> >>>> Let's say module is AFUNC (the closure, not the symbol). >>>> >>>>> AFUNC >>>> Closure AFUNC[2] (T_DESCR C_DESCR) >>>>> (member? AFUNC c-modules) >>>> #f >>>>> (member? 'AFUNC c-modules) >>>> #t >>>>> c-modules >>>> (BOOFUNC FOOFUNC ZOOFUNC AFUNC BLAHFUNC ...) >>>> >>>> How do I get (member? (<something> module) c-modules) to return #t ? >>>> >>>> Thanks, >>>> Geoffrey >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.net email is sponsored by:Crypto Challenge is now open! Get >>>> cracking and register here for some mind boggling fun and the >>>> chance of winning an Apple iPod: >>>> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en >>>> _______________________________________________ >>>> Jscheme-user mailing list >>>> Jsc...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jscheme-user >> >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by:Crypto Challenge is now open! Get >> cracking and register here for some mind boggling fun and the chance >> of winning an Apple iPod: >> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en >> _______________________________________________ >> Jscheme-user mailing list >> Jsc...@li... >> https://lists.sourceforge.net/lists/listinfo/jscheme-user > |