[patch] Better representation of ClassExps in syntax-utils

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch] Better representation of ClassExps in syntax-utils

Jamison Hope
The attached patch adds an unrewrite-class function to syntaxutils.scm,
to handle the expansion of ClassExps.  It's by no means complete, but
a significant step up from treating them as LambdaExps (and throwing
an error in unrewrite-arglist).

Before:

#|kawa:1|# (require 'syntax-utils)
#|kawa:2|# (expand '(define-simple-class Foo (java.util.ArrayList) ((foo) allocation: 'static #!native)))
#<ERROR nyi>

After:

#|kawa:1|# (require 'syntax-utils)
#|kawa:2|# (expand '(define-simple-class Foo (java.util.ArrayList) ((foo) allocation: 'static #!native)))
(let ((Foo #!undefined))
 (set Foo
  (class (<java.util.ArrayList>) ((foo) allocation: (quote static) #!native))))


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



syntaxutils_unrewrite-class.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [patch] Better representation of ClassExps in syntax-utils

Per Bothner
On 05/01/2015 12:26 PM, Jamison Hope wrote:
> The attached patch adds an unrewrite-class function to syntaxutils.scm,
> to handle the expansion of ClassExps.

Thanks - I checked this in.
--
        --Per Bothner
[hidden email]   http://per.bothner.com/