Posting new files...

From: Alberto Santini <albertosantini_at_tiscalinet.it>
Date: Mon, 21 Aug 2000 11:08:57 +0200

Thanks Rick to explain me the use of VALUE.
I prefered to use a variable and to add a private method
to handle the content of variable.

I added KMAP, an associative array implementation (string to word),
and KSTRING, an object porting from a Paysan's implementation
of string.

I hope it's useful to someone.

Ciao,
Alberto

----- Original Message -----
From: "Rick VanNorman" <rvn_at_forth.com>
To: <sftalk_at_forth.com>
Sent: Friday, August 18, 2000 8:59 AM
Subject: Re: [sftalk] Value...

> Alberto,
>
> This usage is incorrect. The use of VALUE while defining a class is
> not permitted. VALUE is a FORTH defining word, not a class defining
> word. A parallel structure can be used, but there are disadvantages.
>
> REQUIRES VALUES \ The package to load is called VALUES
>
> CLASS C1
>
> SINGLE VAL
>
> : TEST ( n -- ) TO VAL ;
>
> END-CLASS
>
> The problem is that class items which are unique to each object of
> the class do not have initialized values such
> as for VALUE -- the object defining word SINGLE takes no parameters
> and must be initialized before use. CONSTANTS have values that are
> specifically *not* unique, and remain constant throughout their use
> as referenced to any object of the class.
>
> I hope this helps.
>
> Rick
>
> *********** REPLY SEPARATOR ***********
>
> On 8/18/2000 at 12:21 AM Alberto Santini wrote:
>
> >Hello.
> >
> >Is it correct the message 'va1 isn't unique'
> >for the code:
> >
> >\ ----------------------
> >class c1
> >private
> > variable v
> > 0 value va1
> > 0 constant ca1
> >end-class
> >
> >class c2
> >private
> > variable v
> > 0 value va1
> > 0 constant ca1
> >end-class
>
>
>
> _______________________________________________
> Sftalk mailing list Sftalk_at_forth.com
> Visit Sftalk on the web at http://www.forthinc.com/mailman/listinfo/sftalk
Received on Mon Aug 21 2000 - 02:32:20 PDT


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.