Re: [Chicken-users] Help solving this phasing problem.

2011-02-12 Thread Taylor Venable
On Sat, Feb 12, 2011 at 16:51, Peter Bex wrote: > This imports module-a (which can be internal and nobody has to know it's > there) both for syntax and normally, and then re-exports the convenience > function. Pardon the interruption, but I wanted to check for my own understanding: is import-for-

Re: [Chicken-users] Help solving this phasing problem.

2011-02-12 Thread Patrick Li
Thanks Peter. That's perfectly good enough. As long as I'm not repeating myself and it's transparent to the user, I can live with it. You've been very helpful. -Patrick On Sat, Feb 12, 2011 at 4:51 PM, Peter Bex wrote: > On Sat, Feb 12, 2011 at 04:35:23PM -0500, Patrick Li wrote: > > > > I hav

Re: [Chicken-users] Help solving this phasing problem.

2011-02-12 Thread Peter Bex
On Sat, Feb 12, 2011 at 04:35:23PM -0500, Patrick Li wrote: > > I have a *very* ugly workaround right now. > I define the convenience function twice. Once normally. And again within a > begin-for-syntax form. You can do the same trick as before: (module module-a (convenience-function) (import

[Chicken-users] Help solving this phasing problem.

2011-02-12 Thread Patrick Li
Hello everyone, I'm creating a module that exports two things, a macro and a function. The definition of the macro happens to require the use of the function. I am having problems creating this module. The defined macro cannot access the function. --Example

Re: [Chicken-users] Implementing a macroexpand-all

2011-02-12 Thread Patrick Li
Thank you for everyone's help! I scrounged together a half-working implementation of macroexpand-all. It recursively macroexpands all the subforms within a form until there are absolutely no macros left in the expression. This is a temporary solution for whoever needs it, as I think Felix probably

Re: [Chicken-users] Implementing a macroexpand-all

2011-02-12 Thread Patrick Li
Thanks for the help! I upgraded to 4.6.0 and everything's fine now. -Patrick On Sat, Feb 12, 2011 at 12:55 PM, Peter Bex wrote: > On Sat, Feb 12, 2011 at 12:18:30PM -0500, Patrick Li wrote: > > Ah I'm using Chicken 4.4.0. > > I'm a beginner to Chicken and just typed "port install chicken" into

Re: [Chicken-users] Implementing a macroexpand-all

2011-02-12 Thread Peter Bex
On Sat, Feb 12, 2011 at 12:18:30PM -0500, Patrick Li wrote: > Ah I'm using Chicken 4.4.0. > I'm a beginner to Chicken and just typed "port install chicken" into my > MacOSX terminal. > I'll figure out how to upgrade Chicken. If you have more questions, it may be more efficient to continue the conv

Re: [Chicken-users] C_word type / Cython (warning: passing argument 2 from incompatible pointer type)

2011-02-12 Thread Jim Ursetto
C_word is the fundamental scheme object type. The underlying type of int or long is just used to make the width of this type 32-bit or 64-bit, and the actual representation is indicated by a type tag (some subset of bits in that word). So it actually can return an arbitrary result. See Data R

Re: [Chicken-users] Implementing a macroexpand-all

2011-02-12 Thread Patrick Li
Ah I'm using Chicken 4.4.0. I'm a beginner to Chicken and just typed "port install chicken" into my MacOSX terminal. I'll figure out how to upgrade Chicken. -Patrick On Sat, Feb 12, 2011 at 12:04 PM, Peter Bex wrote: > On Sat, Feb 12, 2011 at 11:52:40AM -0500, Patrick Li wrote: > > I didn't un

Re: [Chicken-users] Implementing a macroexpand-all

2011-02-12 Thread Peter Bex
On Sat, Feb 12, 2011 at 11:52:40AM -0500, Patrick Li wrote: > I didn't understand what you mean by this part. How do I perform a "full > expansion"? > eg. > (define-syntax mymacro (syntax-rules () ((mymacro) (lambda () 3 > > (expand '(mymacro)) > => (lambda1020 () 3) What version of Chicken a

Re: [Chicken-users] Implementing a macroexpand-all

2011-02-12 Thread Patrick Li
> > After full expansion, you should get ##core#lambda, which is the "core" > lambda. > I didn't understand what you mean by this part. How do I perform a "full expansion"? eg. (define-syntax mymacro (syntax-rules () ((mymacro) (lambda () 3 (expand '(mymacro)) => (lambda1020 () 3) (expand (

Re: [Chicken-users] Implementing a macroexpand-all

2011-02-12 Thread Peter Bex
On Sat, Feb 12, 2011 at 11:15:31AM -0500, Patrick Li wrote: > Thanks for the help Felix! > > There's one more question I stumbled upon actually. Do you know of some way > I can tell if a symbol *actually* refers to lambda or let? > > eg. after some macro expansions, a form might look like (lambda

Re: [Chicken-users] Implementing a macroexpand-all

2011-02-12 Thread Patrick Li
Thanks for the help Felix! There's one more question I stumbled upon actually. Do you know of some way I can tell if a symbol *actually* refers to lambda or let? eg. after some macro expansions, a form might look like (lambda89 (x y) body ...) where lambda89 is equivalent to lambda. Given a symb

Re: [Chicken-users] Using a macro definition within a explicit renaming macro.

2011-02-12 Thread Patrick Li
Thanks for the help. The module workaround will work fine for what I'm doing! -Patrick On Sat, Feb 12, 2011 at 5:36 AM, Felix < fe...@call-with-current-continuation.org> wrote: > > > > There may be a shorter way involving begin-for-syntax or something. > > > > (begin-for-syntax (define-syntax .

Re: [Chicken-users] C_word type / Cython (warning: passing argument 2 from incompatible pointer type)

2011-02-12 Thread David Dreisigmeyer
Thanks Felix, Mt question wasn't clear. What about C_word's use here: int CHICKEN_eval_string (char *str, C_word *result) Wouldn't this be able to return arbitrary results? I was thinking that this is like CHICKEN_eval_string_to_string except an actual scheme expression is returned instead of

Re: [Chicken-users] Using a macro definition within a explicit renaming macro.

2011-02-12 Thread Felix
> > There may be a shorter way involving begin-for-syntax or something. > (begin-for-syntax (define-syntax ...)) should actually work, but it doesn't. I have to investigate this. cheers, felix ___ Chicken-users mailing list Chicken-users@nongnu.org

Re: [Chicken-users] Implementing a macroexpand-all

2011-02-12 Thread Felix
> Does anyone know which forms introduce new bindings? How can I check this > up? `let' and `lambda' introduce new bindings. `let' is not transformed into `lambda', it is handled as a primitive. cheers, felix ___ Chicken-users mailing list Chicken-use

Re: [Chicken-users] C_word type / Cython (warning: passing argument 2 from incompatible pointer type)

2011-02-12 Thread Felix
From: David Dreisigmeyer Subject: [Chicken-users] C_word type / Cython (warning: passing argument 2 from incompatible pointer type) Date: Fri, 11 Feb 2011 17:47:24 -0500 > Here's the solution on the Cython side. > > Is C_word a long (or int) though? > A long on 64-bit platforms and an int on