chicken-users
[Top][All Lists]
Advanced

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

Procedures with keyword arguments (almost SRFI-89)


From: Dominik Pantůček
Subject: Procedures with keyword arguments (almost SRFI-89)
Date: Wed, 24 May 2023 09:48:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

Hello CHICKEN users,

I've implemented a proof-of-concept SRFI-89-like define* and lambda* forms for CHICKEN. I thought I am aiming at SRFI-89 but in reality (given my heavy Racket background) I accidentally implemented Racket-style keyword arguments. Changing it to SRFI-89 is just a matter of two little tweaks to the syntax patterns.

The implementation can be found here:

https://gitlab.com/racketeer/chicken-racket-kwargs

The repository contains just the module and a README file with example usage - including error reporting. Apart from the last error reported, which is pretty generic (and my plan is to report something more meaningful there as well), syntax errors are properly reported during expansion time, procedure usage errors - of course - in run time.

A few questions:

1) Do you think this would be useful for other CHICKEN users and therefore an egg should be created for this eventually?

2) Do you prefer the Racket-style or SRFI-89 variant? (I can roll out both versions without any hassle).

3) I know it is not very efficient as the only CHICKEN-specific part is the if-keyword? syntax (which I tried to implement using various syntax-rules tricks, but ended up implementing a rather simple IR macro). In my opinion it does not matter as I am using it only for "large" procedures and the cost of setting up the bindings is negligible to the procedure body. Do you see any possible straightforward efficiency improvements? Do you think it matters more than I think?

Of course any other suggestions/opinions are more than welcome.

I am using CHICKEN for one little side project and this is part of this project - I just thought it might be useful to split it out and make it into a reusable module.


Cheers,
Dominik



reply via email to

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