bug-guile
[Top][All Lists]
Advanced

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

bug#12341: define does not support lambda shorthand notation, define-pub


From: Ludovic Courtès
Subject: bug#12341: define does not support lambda shorthand notation, define-public does
Date: Mon, 03 Sep 2012 22:29:48 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Hi David,

David Kastrup <address@hidden> skribis:

> scheme@(guile-user)> (define-public ((x a) b) a)
> scheme@(guile-user)> (define ((x a) b) a)
> While compiling expression:
> ERROR: Syntax error:
> unknown file:2:0: source expression failed to match any pattern in form 
> (define ((x a) b) a)

For the latter, one should use (ice-9 curried-definitions), introduced
in 2.0 (see ‘NEWS’), with code like this:

  (cond-expand (guile-2 (use-modules (ice-9 curried-definitions)))
               (else    #t))  ; Guile 1.8 and earlier supports it

That the former works is indeed inconsistent.  It’s due to the fact that
‘define-public’ is implemented as a macro, whereas ‘define’ is a core
form.

I’m inclined to live with the inconsistency, but I’m open to
suggestions.

Thanks,
Ludo’.

PS: This was also discussed at
    <http://thread.gmane.org/gmane.comp.gnu.lilypond.devel/31461>.





reply via email to

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