This is the mail archive of the kawa@sources.redhat.com 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]

Re: Alternate syntax for field access/method calls


"Dominique Boucher" <dominique.boucher@nuecho.com> writes:
> So I decided to extend the Scheme reader to support an alternate
> syntax for accessing fields and calling methods. With this new
> syntax, the example becomes:
>
>   [someObject (method1) (method2 a b)]

Nice! 

For myself, I use namespaces 99% of the time.  So instead of:

>   (invoke (invoke someObject 'method1) 'method2 a b)

I write:

    (define-namespace class1 <com.merced.SomeClass>)
    (define-namespace class2 <com.merced.SomeClass2>)

    (class2:method2 (class1:method1 someObject) a b)

You can also do this if it's more convenient:

    (com.merced.SomeClass2:method2 (com.merced.SomeClass:method1 someObject) 
                                   a b)

Regards,
Chris Dean


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