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: David Kastrup
Subject: bug#12341: define does not support lambda shorthand notation, define-public does
Date: Mon, 03 Sep 2012 20:05:25 +0200

Having this supported in define-public but not in define seems like an
inconsistency:


address@hidden:/usr/local/tmp/lilypond$ guile
GNU Guile 2.0.5-deb+1-1
Copyright (C) 1995-2012 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
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)
scheme@(guile-user)> 

The Scheme report does not mention this explicitly, but it would appear
as a recursive application of the rule
(define (a b) ...) -> (define a (lambda (b) ...))

leading first to

(define (x a) (lambda (b) a))

and thence to

(define x (lambda (a) (lambda (b) a)))

And if it is not supposed to be supported, why is it supported with
define-public?

-- 
David Kastrup





reply via email to

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