bug-kawa
[Top][All Lists]
Advanced

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

[Bug-kawa] [bugs #11782] typed optional params not working?


From: Steve Yegge
Subject: [Bug-kawa] [bugs #11782] typed optional params not working?
Date: Sat, 29 Jan 2005 19:57:22 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11782>

                 Summary: typed optional params not working?
                 Project: Kawa
            Submitted by: stevey
            Submitted on: Sat 01/29/2005 at 19:57
                Category: Scheme language
                Severity: 5 - Average
              Item Group: Compile-time exception
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open

    _______________________________________________________

Details:

The docs say OPT-ARGs are bound to #f if not provided

and there's no initializer specified.  This works properly

for untyped OPT-ARGS, but not if you specify a type.



(define (bar #!optional num)

  (display num))



(bar)

#f



(bar 2)

2





(define (foo #!optional num :: <int>)

  (display num))

<stdin>:87:1: warning - cannot convert literal (of type java.lang.Boolean)
to

int



(foo)

Invalid parameter, was: null

java.lang.ClassCastException

        at atInteractiveLevel$29.foo(<stdin>)

        at atInteractiveLevel$29.apply0(<stdin>:87)

        at gnu.expr.ModuleMethod.apply0(ModuleMethod.java:177)

        at gnu.expr.ModuleMethod.apply(ModuleMethod.java:151)

        at gnu.mapping.CallContext.runUntilDone(CallContext.java:237)

        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:256)

        at kawa.Shell.run(Shell.java:231)

        at kawa.Shell.run(Shell.java:177)

        at kawa.Shell.run(Shell.java:164)

        at kawa.Shell.run(Shell.java:151)

        at kawa.repl.main(repl.java:672)



(foo 2)

2








    _______________________________________________________

This item URL is:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=11782>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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