chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] functor support


From: Jörg F. Wittenberger
Subject: Re: [Chicken-hackers] functor support
Date: Mon, 10 Sep 2018 11:50:35 +0200

Hi Megane,

I understand that a functor in Chicken is more like a template.

As you detailed it is possible to use macro expansion tricks instead of
the include statement, essentially expanding the include manually.
That's roughly what I'd feel chicken should do in the first place.

To me as a user who wants to package a functor into an egg, it is
surprise that the compiled and installed egg will include rather
arbitrary files from the current directory.

Together with the line number issue functors look a bit like a second
thought and not well supported.  In practice I'm going through some
effort to avoid functors where I'd actually like to use them.  (And
still did not come up with a nice recipe how to do so.)


Best

/Jörg

Am Sun, 09 Sep 2018 08:59:59 +0300
schrieb megane <address@hidden>:

> 
> Hi Jörg,
> 
> Jörg F. Wittenberger <address@hidden> writes:
> 
> > Hi Chickeneers,
> >
> > attached is a test trying to package the functor example from the
> > documentation as an egg.  This is no good except to showcase some
> > issues.
> >
> > 1. "include" should be expanded.  (I reported this before, now here
> > is the simple example.)
> 
> I'm pretty sure this is not the way functors work. The functor body is
> not walked at definition time at all. You can check this by putting
> (begin-for-syntax (display "here")) in the functor definition, or just
> put some invalid code like () or module definition (should cause inner
> module warning.) Functors are more like templates.
> 
> If you want to have the functor definition in a different file you can
> expand the functor with a macro and splice in the other file's
> contents there.
> 
> >
> > 2. Line numbers for errors refer to an unexpected location: all
> > blame is assigned to the instatiation line.  (This is rather
> > annoying for me.)
> >
> 
> This would indeed be helpful. I have no idea how much work it would be
> to implement this.
> 
> Regards,
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]