This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix NPE in define-procedure without keywords


This fails with a NullPointerException:

(define-procedure f
  (begin (define (f o) o)
         f))

even though it seems like it should be equivalent to:

(define-procedure f
  (lambda (o) o))

which works.  This also works:

(define-procedure f
  irrelevant-property: "unimportant-value"
  (begin (define (f o) o)
         f))

which helped me realize that the problem was that the lazily-defined
"bexp2" BeginExp -- which is where both keyword/value settings and
non-LambdaExp method additions are stored -- was only being instantiated
when a keyword/value pair is found.

The attached patch ensures that bexp2 exists before it is used in the
non-keyword code path.

--
Jamison Hope
The PTR Group
www.theptrgroup.com


Attachment: define.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]