guile-devel
[Top][All Lists]
Advanced

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

Re: srfi-39 implementation


From: Jose A. Ortega Ruiz
Subject: Re: srfi-39 implementation
Date: Fri, 14 May 2004 01:23:52 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Kevin Ryde <address@hidden> writes:

> "Jose A. Ortega Ruiz" <address@hidden> writes:
>>
>> Although you are right in that primitive-make-property & co. can be
>> used, i think the case-based thing is slightly lighter and maybe even
>> faster, since no hashtable creation/lookup is involved. Or, at any
>> rate, the difference should be minimal,
>
> Ok.  Another possibility I guess (for both styles) would be a single
> call or lookup giving back both fluid and converter.  Doesn't quite
> suit the way with-parameters* does its `map's though.
>

Yes. I cannot think at the moment of a simple way of using a single
call---all that comes to mind involves call-with-values, fold or the
like, and makes the code more complex.

>> (define-module (srfi srfi-39)
>>   #:export (make-parameter)
>>   #:export-syntax (parameterize)
>>
>>   ;; procedure not in srfi-39.
>>   #:export (with-parameters*))
>
> One #:export (with whatever comment) is enough I expect.
>

OK.

>
> In emacs
>
>       (put 'with-test-prefix 'scheme-indent-function 1)
> [...]

Ah. Thanks for the tip. I had overlooked it.

>
>>  (let ((conv (lambda (x) (if (x > 10) 10 x))))
>>    (pass-if "converter 1" (let ((a (make-parameter 32))) (eqv? (a) 32)))
>
> A leftover from something?  conv seems unused, and "(x > 10)" looks
> pretty doubtful.
>

Ooops. An error. 'conv', or rather, a correct version of it, was meant
to be used in the tests within the 'let'. I've corrected it.

> Otherwise looks good to me.

Great. Please find attached a new version of both files that,
hopefully, addresses the above issues (except the single lookup).

Best regards,
jao
-- 
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare. - Blair Houghton.

Attachment: srfi-39.scm
Description: Binary data

Attachment: srfi-39.test
Description: Binary data


reply via email to

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