This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
RE: extended "colon notation" [feedback needed]
- From: <Fernando dot Matomira at thomson dot com>
- To: <kawa at sources dot redhat dot com>
- Date: Thu, 4 Aug 2005 09:21:21 +0200
- Subject: RE: extended "colon notation" [feedback needed]
Does this cause any problems to people using symbols with colons
in them for compatibility with Common Lisp?
For example, CL:IF macro.
-----Original Message-----
From: kawa-owner@sources.redhat.com
[mailto:kawa-owner@sources.redhat.com] On Behalf Of Per Bothner
Sent: Thursday, August 04, 2005 6:22 AM
To: kawa@sources.redhat.com
Subject: Re: extended "colon notation" [feedback needed]
In addition to the check-in features, I'm considering the following:
(1) To check that a value is an instance of a type:
(TYPE:instance? VALUE)
;; same as (instance? VALUE TYPE)
Alternative syntaxes considered:
(TYPE:instanceof? VALUE) ;; similar to Java instanceof
(TYPE:? VALUE) ;; short and sweet
(2) To cast a value to a type:
(TYPE:<- VALUE)
;; same as (as VALUE TYPE)
The <- is meant to be like the arrows in say number->string, but
backwards, since the target TYPE is mentioned first. It's a bit ugly,
so alternative syntax would be welcome.
(3) Accessing the java.lang.Class for a class type:
(TYPE:.class)
;; similar to (Class:forName "TYPE"), or Java's TYPE.class
Alternative syntax considered:
(TYPE:class) ;; i.e. without the dot.
Comments? Speak up quickly!
--
--Per Bothner
per@bothner.com http://per.bothner.com/