emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#9776: closed (case-lambda should accept zero claus


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#9776: closed (case-lambda should accept zero clauses)
Date: Sat, 09 Mar 2013 10:19:02 +0000

Your message dated Sat, 09 Mar 2013 11:17:44 +0100
with message-id <address@hidden>
and subject line Re: bug#9776: case-lambda should accept zero clauses
has caused the debbugs.gnu.org bug report #9776,
regarding case-lambda should accept zero clauses
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
9776: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9776
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: case-lambda should accept zero clauses Date: Mon, 17 Oct 2011 12:15:40 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)
Hello guilers,

the case-lambda form is specified in r6rs-lib as accepting any number of
clauses, including zero. So this should not give an error:

scheme@(guile-user)> (case-lambda)
While compiling expression:
ERROR: Syntax error:
standard input:1:0: case-lambda: bad case-lambda in form (case-lambda)

Instead it should return a procedure that never gets the right number of
arguments.

Regards,

-- 
Göran Weinholt <address@hidden>



--- End Message ---
--- Begin Message --- Subject: Re: bug#9776: case-lambda should accept zero clauses Date: Sat, 09 Mar 2013 11:17:44 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)
On Sat 02 Mar 2013 19:13, Andy Wingo <address@hidden> writes:

> Picking up an old thread.  What do people think about the attached
> patch?  It preserves arity checking for case-lambdas defined in the same
> compilation unit.  Case-lambdas are converted to nullary procedures in
> the last minute, before compiling or memoizing.  Calling one of these
> procedures with arguments will still produce an arity-check warning;
> calling one without arguments will not.  In both cases a
> wrong-number-of-args exception is thrown at runtime (either by the
> normal argument count check or via the explicit throw in the body).
>
> I think allowing lambda-body to be #f is the right way to go because it
> precludes inlining of ((case-lambda)).
>
> I'll push soon if there are no comments.

Pushed.  Later we can figure out a way to warn for all applications of
(case-lambda), regardless of arity.

Andy
-- 
http://wingolog.org/


--- End Message ---

reply via email to

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