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: new experimental "part extraction" syntax


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


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