On Jun 3, 2009, at 2:38 AM, Ramana Kumar wrote:

There's a macro concept that I don't know the name for.

Not "local-expand" that's mentioned in the message you're replying to?

I wonder if
anyone on here knows the name and whether there's been much discussion
about its drawbacks (i.e. reasons why it's not used) before.

Its main problem is that it's not (and won't be) supported. :-)

The idea
is a transformer that can expand its subforms before doing its
transformation.

Sounds like "local-expand", no?
No macro that I've ever written needed to do this.  And why would you
want to expand the code yourself if the expander is already going to
do that for you?

My motivations are that it makes certain macros as
easy to write as recursive procedures (you don't have to resort to
CPS),

You resort to CPS when all you have is syntax-rules.  With syntax-case
I don't see why you ever need to CPS your macros since you can do as
you please with the input syntax object (take it apart, play with it,
put it back together, etc).  I really want to see these certain macros
that make you have to CPS.

and it may be necessary for a macro-based type checking system.

I don't have anything more to add to what I already said (below)
regarding this.

Aziz,,,


On Fri, Apr 24, 2009 at 4:53 AM, Abdulaziz Ghuloum <[email protected]> wrote:

On Apr 23, 2009, at 1:31 PM, Ramana Kumar wrote:

I've asked about this on comp.lang.scheme, but I'd also like to see if
there are Ikarus-specific solutions.

Is it possible to write a macro-friendly type-checker that signals
errors, if any, during expansion and disappears afterwards?

Nop.

Typed
Scheme does this, but requires PLT's local-expand to expand all other macros before type checking. I don't think Ikarus has anything public
like local-expand, right?

Right.  Typed scheme requires more than local-expand to work since
its whole design is based on expand-time side effects, multiple
instantiation of libraries, and probably other things.  Not one of
these PLT-specific features is currently supported (or even likely
to be supported in the future) by any other Scheme implementation.

Is it possible to write lazy-lambda that creates a procedure for which
application is call-by-need?

No.  The procedure is in no way tied to the call sites.

I know you could write a lazy-define to
create procedures that were actually macros that wrapped arguments in
thunks, but what about anonymous or first-class procedures?

It won't work.

I think
this would require taking over the application syntax "(rator rand
....)", which I think is possible with PLT's app macros;

That's one way, but these procedures won't work if, say, they're
exported to modules that are not lazy.  In a strict language, you
have to arrange to call lazy procedures in a special way.
Similarly, you need to call eager procedures in a lazy language
in a special way.  (I don't know how/if that works well)

Anyways, Ikarus does not have an implicit %app macro, and when it
does, it won't be compatible with PLT's (read the description of
that in the PLT reference).

I'm not sure how the solution should look.

Google for lazy scheme. :-)

Aziz,,,


Reply via email to