There's a macro concept that I don't know the name for. 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. The idea
is a transformer that can expand its subforms before doing its
transformation. My motivations are that it makes certain macros as
easy to write as recursive procedures (you don't have to resort to
CPS), and it may be necessary for a macro-based type checking system.

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