[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some more nitpicks



On Sun, Aug 04, 2002 at 12:58:18PM -0400, Jonathan Bachrach wrote:
> > Also, (new) is currently like:
> > (new <my-class> prop1 value1 prop2 value2)
> >
> > Would it not be better to have it:
> > (new <my-class> (prop1 value1) (prop2 value2))
> 
> no, because new is not a special form.  users can write methods on new
> and take initializers as a rest argument.  as an example, consider the
> new method for threads:
> 
>   (dm new (x|(t< <thread>) args|... => <thread>)
>     (def t (app-sup x args))
>     (unless (== (thread-function t) main-thread-key) ...)
>     t)
> 
> i accept that the prop value's run together a bit too much for my
> liking.  i'm trying to avoid using keywords instead of real generics
> for tagging the properties.  using real generics allows one to limit
> prop initialization through namespace hiding, whereas keywords don't
> have that control.

Well, howabout making a new special form for this purpose:
(new <my-class> (vals (prop1 value1) (prop2 value2)))

(vals) could return something that it would parse (a tuple maybe?)

-- 
Jonathan Hseu <vomjom@vomjom.org, vomjom@debian.org, jh4@cec.wustl.edu>
GPG ID:          5228D713
GPG fingerprint: 220B A4EF 70FE B884 CB38  F93F EA8A 1024 5228 D713