Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: Creating an...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 65 Topic 3945 of 4285
Post > Topic >>

Re: Creating and using arrays - again

by Albert van der Horst <albert@[EMAIL PROTECTED] > Mar 22, 2008 at 12:19 PM

In article
<alpine.OSX.1.00.0803211430350.2044@[EMAIL PROTECTED]
>,
Duke Normandin  <dukeofperl@[EMAIL PROTECTED]
> wrote:
>On Fri, 21 Mar 2008, Elizabeth D Rather wrote:
>
>>
>>
>> Duke Normandin wrote:
>> > On Fri, 21 Mar 2008, Elizabeth D Rather wrote:
>> ...
>> >
>> > > A more Forthish approach would be:
>> > >
>> > > : ARRAY ( n -- )   CREATE  CELLS ALLOT
>> > >    DOES> ( i -- i-addr )   CELLS + ;
>> >
>> > I'm just now clueing in on Forth's 'double-barrel' / 'delayed-duet'
>> > capability of CREATE / DOES>
>>
>> The best way to think about it is that the part before the DOES>
specifies a
>> class of words with a shared defining behavior.  The part after the
DOES>
>> defines the shared behavior of all instances of this class of
definitions.
>
>I got it! Every "array" incarnated using ARRAY will all be created using
>the "defining words". Everyone of these "arrays" will execute the words
>following DOES> when called with the appropriate value in TOS.
>

And note that this is the same idea as having cl*****.
[This was in Forth 15 years before most people had heard of cl*****!]
A class defines a data structure with common behaviour. So the "class"
ARRAY can be used to have arrays. ARRAY APE gives you an "object" APE.
The difference with "real" cl***** is that you don't have named
methods, the only thing you can do is say ``APE'' and the default
behaviour (of DOES> ) happens.

You can always help yourself out by using >BODY though. Look it up!

>Duke Normandin

Groetjes Albert

--
-- 
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@[EMAIL PROTECTED]
 &=n http://home.hccnet.nl/a.w.m.van.der.horst
 




 65 Posts in Topic:
Creating and using arrays - again
Duke Normandin <dukeof  2008-03-21 15:54:28 
Re: Creating and using arrays - again
Elizabeth D Rather <er  2008-03-21 11:49:44 
Re: Creating and using arrays - again
Duke Normandin <dukeof  2008-03-21 18:51:11 
Re: Creating and using arrays - again
Elizabeth D Rather <er  2008-03-21 15:16:05 
Re: Creating and using arrays - again
Duke Normandin <dukeof  2008-03-21 20:37:06 
Re: Creating and using arrays - again
JK <jk.usenet@[EMAIL P  2008-03-21 14:59:30 
Re: Creating and using arrays - again
Albert van der Horst <  2008-03-22 12:19:21 
Re: Creating and using arrays - again
Duke Normandin <dukeof  2008-03-22 21:53:06 
Re: Creating and using arrays - again
Jonah Thomas <jethomas  2008-03-21 12:14:43 
Re: Creating and using arrays - again
Duke Normandin <dukeof  2008-03-21 18:57:07 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-22 12:55:51 
Re: Creating and using arrays - again
Duke Normandin <dukeof  2008-03-22 17:35:49 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-22 13:58:37 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-22 14:02:28 
Re: Creating and using arrays - again
kenney@[EMAIL PROTECTED]   2008-03-23 14:37:59 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-21 10:20:33 
Re: Creating and using arrays - again
Duke Normandin <dukeof  2008-03-21 18:36:16 
Re: Creating and using arrays - again
Jonah Thomas <jethomas  2008-03-21 15:28:15 
Re: Creating and using arrays - again
Krishna Myneni <krishn  2008-03-21 20:20:55 
Re: Creating and using arrays - again
Duke Normandin <dukeof  2008-03-22 03:06:35 
Re: Creating and using arrays - again
Duke Normandin <dukeof  2008-03-22 17:32:04 
Re: Creating and using arrays - again
"Mark W. Humphries&q  2008-03-21 21:05:28 
Re: Creating and using arrays - again
Andrew Haley <andrew29  2008-03-22 14:33:04 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-22 06:01:33 
Re: Creating and using arrays - again
Jonah Thomas <jethomas  2008-03-22 10:29:43 
Re: Creating and using arrays - again
Andrew Haley <andrew29  2008-03-22 14:36:34 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-22 12:48:49 
Re: Creating and using arrays - again
<Montesquiou>   2008-03-22 19:23:19 
Re: Creating and using arrays - again
Andrew Haley <andrew29  2008-03-22 22:19:36 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-22 22:45:21 
Re: Creating and using arrays - again
Andrew Haley <andrew29  2008-03-23 12:13:19 
Re: Creating and using arrays - again
Coos Haak <chforth@[EM  2008-03-23 13:37:55 
Re: Creating and using arrays - again
Andrew Haley <andrew29  2008-03-23 13:06:36 
Re: Creating and using arrays - again
Elizabeth D Rather <er  2008-03-23 09:10:08 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-23 10:50:39 
Re: Creating and using arrays - again
Andrew Haley <andrew29  2008-03-23 15:50:35 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-23 10:49:26 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-23 10:47:31 
Re: Creating and using arrays - again
Elizabeth D Rather <er  2008-03-23 11:33:59 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-25 17:39:47 
Re: Creating and using arrays - again
Dennis Ruffer <druffer  2008-03-26 00:57:35 
Re: Creating and using arrays - again
Elizabeth D Rather <er  2008-03-25 20:43:54 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-26 11:00:22 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-22 08:44:53 
Re: Creating and using arrays - again
"Mark W. Humphries&q  2008-03-22 11:16:58 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-22 12:05:35 
Re: Creating and using arrays - again
Jonah Thomas <jethomas  2008-03-22 17:02:25 
Re: Creating and using arrays - again
Josh Grams <josh@[EMAI  2008-03-23 13:18:16 
Re: Creating and using arrays - again
Elizabeth D Rather <er  2008-03-23 08:53:42 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-22 16:03:57 
Re: Creating and using arrays - again
Jerry Avins <jya@[EMAI  2008-03-22 22:46:54 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-23 06:23:42 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-23 06:46:58 
Re: Creating and using arrays - again
Albert van der Horst <  2008-03-24 02:48:31 
Re: Creating and using arrays - again
"Mark W. Humphries&q  2008-03-23 08:40:13 
Re: Creating and using arrays - again
Jonah Thomas <jethomas  2008-03-23 12:32:11 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-23 12:02:17 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-23 14:17:56 
Re: Creating and using arrays - again
Elizabeth D Rather <er  2008-03-23 17:48:14 
Re: Creating and using arrays - again
Jonah Thomas <jethomas  2008-03-23 18:55:28 
Re: Creating and using arrays - again
Elizabeth D Rather <er  2008-03-23 19:02:53 
Re: Creating and using arrays - again
"Mark W. Humphries&q  2008-03-23 17:26:40 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-23 21:13:31 
Re: Creating and using arrays - again
Albert van der Horst <  2008-03-24 15:51:05 
Re: Creating and using arrays - again
Bruce McFarling <agila  2008-03-24 09:27:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 13:51:35 CDT 2008.