[Top][All Lists]

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

Re: srfi-89 implementation for guile

From: Linus Björnstam
Subject: Re: srfi-89 implementation for guile
Date: Mon, 10 Aug 2020 23:26:40 +0200
User-agent: Cyrus-JMAP/3.3.0-143-g3d58b38-fm-20200806.002-g3d58b387

Well done! Macros are great fun. I glanced through your source and could follow 
it without much hickups. You probably know this already, but you can actually 
do the sanitize-rest at compile time for cases where the procedure is not 
passed as an argument to some.other procedure.

Say we (define* (blah ...) Body...).

Then you define one function that does argument checking (%blah-check) at 
runtime and one that does not (%blah)

Then make the regular blah a macro. Using identifier macros you dispatch to 
%blah-check if it is not used in call position, or check all keyword arguments 
and sanitize them at compile time and dispatch it to %blah. 

I spent some time implementing define-inlinable*, a keyword-aware 
define-inlinable, using that. I never baked it fully, so I never submitted a 
patch, but that is the approach I took, and the approach that define-inlinable 
uses which you can find in the guile sources.

  Linus Björnstam

On Mon, 10 Aug 2020, at 22:07, Martin Becze wrote:
> Hi Guilers,
> I implemented srfi-89 (Optional positional and named parameters)
> It is hygienic and reuses guile's lambda* so there is minimal overhead.
> Cheers!,
> -Martin Becze
> Attachments:
> * signature.asc

reply via email to

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