This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: extended "colon notation" [feedback needed]
> (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.
This is a tough one. If we end up with (TYPE:? x) then there is a
certain symmetry to (TYPE:<- x). It's difficult to think of a good
keyword that someone might reasonably choose as a method name.
If I'm forced to, I'd vote for (TYPE:instanceof? x) and (TYPE:<- x)
even if it is not symmetric.
Regards,
Chris Dean