Re: [Chicken-users] Determine if program has been compiled

2014-07-12 Thread Peter Bex
On Sat, Jul 12, 2014 at 11:09:24AM -0700, Christopher Collins wrote:
 Hello chicken users,
 
 Is there a way to determine, in code, whether a chicken program has been
 compiled?  I am thinking of something similar to:
 
 (cond-expand
 (chicken-script ... )
 
 ...but with an identifer different from chicken-script.

Hello Christopher,

There's a cond-expand identifier called compiling.  See also
http://wiki.call-cc.org/man/4/Non-standard%20macros%20and%20special%20forms#cond-expand
for other identifiers that you can dispatch on with cond-expand.

Cheers,
Peter
-- 
http://www.more-magic.net

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Determine if program has been compiled

2014-07-12 Thread Mario Domenech Goulart
Hi Christopher,

On Sat, 12 Jul 2014 11:09:24 -0700 Christopher Collins 
ccollins47...@gmail.com wrote:

 Is there a way to determine, in code, whether a chicken program has
 been compiled? I am thinking of something similar to:

 (cond-expand
 (chicken-script ... )

 ...but with an identifer different from chicken-script.

 It is possible that I'm asking the wrong question. My underlying
 problem is: I want my program to behave one way when I load it from
 within csi, and another way when I either execute it with csi -
 script or compile it and execute the binary. In particular, to make
 debugging easier, I want to skip command line parsing when I load the
 code in csi.  The cond-expand,chicken-script form lets me determine
 when the program was run with csi -script. However, it does not
 solve the compile-and-run scenario; the resulting executable behaves
 as though it were loaded into csi.

Maybe http://wiki.call-cc.org/compiler%20or%20interpreter can be
helpful.

Best wishes.
Mario
-- 
http://parenteses.org/mario

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Determine if program has been compiled

2014-07-12 Thread Christopher Collins
On Sat, Jul 12, 2014 at 11:12 AM, Peter Bex peter@xs4all.nl wrote:

 There's a cond-expand identifier called compiling.  See also

http://wiki.call-cc.org/man/4/Non-standard%20macros%20and%20special%20forms#cond-expand
 for other identifiers that you can dispatch on with cond-expand.

On Sat, Jul 12, 2014 at 11:18 AM, Mario Domenech Goulart 
mario.goul...@gmail.com wrote:

 Maybe http://wiki.call-cc.org/compiler%20or%20interpreter can be
 helpful.

Thank you, Peter and Mario.  That does exactly what I need!

Christopher
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users