initialize slots without a modifier?

"Scott G. Miller" <[email protected]> Sun, 21 Oct 2007 09:48:13 -0500
Newsgroups gmane.comp.java.sisc.user
Message-ID <[email protected]>
On 10/21/07, Mike J. Bell <[email protected]> wrote:
> On 10/21/07, Scott G. Miller <[email protected]> wrote:
> > On 10/20/07, Mike J. Bell <[email protected]> wrote:
> > [snip]
> >
> > If a class contains a slot that doesn't have a modifier, you can still
> > modify it using the direct slot accessors described here:
> >
> > http://sisc-scheme.org/manual/html/ch07.html#OOSlots
>
>
> Thanks Scott...I just didn't read hard enough.  Sorry for the re-re-posting;
> I guess Sourceforge's list display is behind.
>
> > Mostly accessors and modifiers produce a shorthand way to defined them
> > on the class, avoiding the lower level slot API.  They are are also
> > generics, so you can have an accessor which operates on more than one
> > class, while the slot API accesses only the slots for a particular
> > class.
>
>
> This brings up another question.  If I
>
> (define-generics foo bar baz)
>
> (...) ; make methods on foo bar and baz, then
>
> (define-generics foo bar baz)
>
> I've effectively erased those methods and I'm starting from scratch with new
> generic procedures.  I found this out by naming methods the same thing
> between different classes.  I would imagine the only way to get around this
> is to only define-generics once per generic procedure name.  Is there a good
> way to do it?  Almost like import, where you atomically define a generic
> procedure name only if it doesn't already exist?
>

There is no such functionality in SISC, just as there isn't for
ordinary Scheme define.  This is sort of a coding style problem, where
typically I place definitions in their own file or module, so that
there isn't any chance of conflict.  You should be able to do this
with syntax-case however if you really wanted to.

Scott

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/