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]

Re: Groovy vs. Kawa smackdown ;-) (was Re: Java array class is not kawa Class?)


Jim White wrote:
As you well know, I'm a long time Lisper and Kawa supporter, but S-expression notation is just not gonna get most folks excited.

I have mixed feelings about S-expressions, myself. I like having an extensible syntax and no reserved identifiers. Otherwise, I'd like to make parentheses optional except for grouping. (If you start Kawa with the --q2 switch, you get an experimental hybrid line-oriented syntax, but it's too incomplete/inconsistent for real use.)

One way in which Kawa is more compact than Groovy is in property acesses
and "beans".  From http://groovy.codehaus.org/Groovy+Beans

Groovy:
        Customer customer = new Customer();
        customer.setId(1);
        customer.setName("Gromit");
        customer.setDob(new Date());

println("Hello " + customer.getName());

Kawa:

(define customer (Customer id: 1 name: "Gromit" dob: (Date)))
(format "Hello %s%~" customer:name)


Class definition:


(define-class Customer ()
  (id :: <integer>)
  (name :: <string>)
  (dob :: <java.util.Date>))

However, I agree that Groovy seems a nice enough language, with
some nice ideas.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


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