GNU bug report logs - #12341
define does not support lambda shorthand notation, define-public does

Previous Next

Package: guile;

Reported by: David Kastrup <dak <at> gnu.org>

Date: Mon, 3 Sep 2012 18:08:01 UTC

Severity: normal

Done: Ian Price <ianprice90 <at> googlemail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: ludo <at> gnu.org (Ludovic Courtès)
To: David Kastrup <dak <at> gnu.org>
Cc: 12341 <at> debbugs.gnu.org
Subject: bug#12341: define does not support lambda shorthand notation, define-public does
Date: Mon, 03 Sep 2012 22:29:48 +0200
Hi David,

David Kastrup <dak <at> gnu.org> 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>.




This bug report was last modified 12 years and 321 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.