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: 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/


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