This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: new experimental "part extraction" syntax
- From: Bruce Lewis <brlewis at ALUM dot MIT dot EDU>
- To: kawa at sourceware dot org
- Date: 27 Dec 2005 13:35:34 -0500
- Subject: Re: new experimental "part extraction" syntax
- References: <4394B602.4040308@bothner.com>
Per Bothner <per@bothner.com> writes:
> For more details:
> http://www.gnu.org/software/kawa/PathExpressions.html
Here's the first example from the current docs:
Field parts:
(list 3 4 5)\car ==> 3
(list 3 4 5)\cdr\car ==> 4
One thing I like about the Lisp family of languages is how you see the
end result as you're looking at the very beginning. Looking to the end
to see the result seems a lot more procedural.
Additionally, this syntax requires that there be no whitespace, so
indentation for complex expressions built this way is impossible.
What about something like a subset of JScheme's javadot notation? For
example, the evaluator could be extended to allow keywords in the first
position:
(:car (list 3 4 5)) ==> 3
(:car (:cdr (list 3 4 5))) ==> 4
Method parts:
(#xff\toString) ==> 255
(255\equals #xff) ==> #t
Rather than making expression\name equivalent to a lambda expression
when name is a method, what about simply making syntax that invokes the
method based on the value returned from the second position?
(:toString #xff) ==> 255
(:equals 255 #xff) ==> #t