Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #41871
| Newsgroups | comp.lang.forth |
|---|---|
| Date | 2015-09-08 19:08 -0700 |
| References | <ca411208-dff1-45ff-8111-1dffbfb32baf@googlegroups.com> <1b9c5435-729c-4e4a-9775-b01262fadaff@googlegroups.com> <OZOdnXY8jIpwvXLInZ2dnUU7-WmdnZ2d@supernews.com> |
| Message-ID | <b2351997-e2af-435f-8a60-c736440e9b93@googlegroups.com> (permalink) |
| Subject | Re: Could Forth be getting a bit of traction? |
| From | hughaguilar96@gmail.com |
On Tuesday, September 8, 2015 at 10:54:54 AM UTC-7, Elizabeth D. Rather wrote: > On 9/8/15 12:45 AM, Mux wrote: > > So while we're on (de)structs... In ye olde days of 6502 programming, I used what I called 'vertical arrays' which is basically a struct, and to this day, I use as an alternative to structs. > > > > variable x 16 allot > > variable y 16 allot > > variable z 16 allot > > > > : get_x ( index -- x ) x + @ ; > > : get_y ( index -- y ) y + @ ; > > : get_z ( index -- z ) z + @ ; > > > > while technically not a struct in the C sense in that the, it's every bit as powerful without having to declare / create structures in forths that don't have them. > > Your use of @ implies you meant this to be an array of cells, but you > ALLOTed in bytes :-) > > more Forthish way to do this is: > > : ARRAY ( n -- ) CREATE CELLS ALLOT > DOES> ( i -- a ) SWAP CELLS + ; > > ARRAY X ARRAY Y ARRAY Z > > And if you wanted to build in bounds checking, etc., you can do it > centrally in ARRAY. Not at all C-ish. > > Cheers, > Elizabeth The use of multiple arrays, one for each field, is the work-around that was used in QBasic as I described previously. Note that the code Elizabeth Rather is presenting was copied directly out of "Starting Forth." It has the index beginning at 0 as is typical. AFAIK, all the code in "Starting Forth" was written by Chuck Moore. The following is the ONLY example of code that that Elizabeth Rather has ever posted that wasn't copied directly out of "Starting Forth," but which she wrote herself: On Sunday, August 9, 2015 at 7:30:10 PM UTC-7, Elizabeth D. Rather wrote: > Here's [an array definer] presented in my Forth Application Techniques that I think is > far more useful than the FSL version: > > : ARRAY ( n -- ) CREATE DUP , CELLS ALLOT > DOES> ( n -- a) SWAP OVER @ OVER < OVER > 1 < OR ABORT" Out of Range" CELLS + ; Here she has the index starting at 1 rather than 0 because that is what she learned in COBOL --- at the time that she wrote this, she no longer had Chuck Moore around to write her code for her, so she had to take a stab at writing code herself. Aside from the fact that using multiple arrays rather than struts is clumsy and inefficient, none of these array definers are any good anyway. They aren't general-purpose because they only work for cell-sized elements. Also, the use of CREATE DOES> makes them grossly inefficient. The inherent inefficiency of CREATE DOES> has been discussed many times before, most recently here: https://groups.google.com/forum/#!topic/comp.lang.forth/yTvD4nqPGA4%5B101-125%5D BTW: Does anybody else find it ironic that this thread is titled, "Could Forth be getting a bit of traction?" --- and yet, we now have Elizabeth Rather promoting the use of multiple arrays each for a field, rather than structs --- our car is getting plenty of traction, but unfortunately we have our gear-shift in reverse...
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Could Forth be getting a bit of traction? Mark Wills <markwills1970@gmail.com> - 2015-09-01 00:49 -0700
Re: Could Forth be getting a bit of traction? mentificium@gmail.com - 2015-09-01 04:18 -0700
Re: Could Forth be getting a bit of traction? Steve Graham <jsgrahamus@yahoo.com> - 2015-09-01 09:51 -0700
Re: Could Forth be getting a bit of traction? Andreas Wagner <andreas.wagner@lowfatcomputing.org> - 2015-09-01 10:23 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-02 13:53 -0700
Re: Could Forth be getting a bit of traction? Greg <borota@gmail.com> - 2015-09-04 17:35 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-04 18:27 -0700
Re: Could Forth be getting a bit of traction? Mux <Yvo.Zoer@gmail.com> - 2015-09-04 21:04 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-09-05 00:27 -0400
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-04 21:48 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-09-05 01:10 -0400
Re: Could Forth be getting a bit of traction? Mux <Yvo.Zoer@gmail.com> - 2015-09-04 22:19 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-04 23:31 -0700
Re: Could Forth be getting a bit of traction? Mux <Yvo.Zoer@gmail.com> - 2015-09-05 07:28 -0700
Re: Could Forth be getting a bit of traction? Alfred Singlestone <vitonis@gmail.com> - 2015-09-05 08:10 -0700
Re: Could Forth be getting a bit of traction? foxaudioresearch@gmail.com - 2015-09-05 09:05 -0700
Re: Could Forth be getting a bit of traction? visualforth@rocketmail.com - 2015-09-05 09:07 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-09-05 13:08 -0400
Re: Could Forth be getting a bit of traction? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-05 16:32 +0000
Re: Could Forth be getting a bit of traction? Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-05 22:19 +0200
Re: Could Forth be getting a bit of traction? Jason Damisch <jasondamisch@yahoo.com> - 2015-09-05 13:28 -0700
Re: Could Forth be getting a bit of traction? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-06 12:09 +0000
Re: Could Forth be getting a bit of traction? Richard Owlett <rowlett@cloud85.net> - 2015-09-06 13:27 -0500
Re: Could Forth be getting a bit of traction? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-07 15:36 +0000
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-07 09:46 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-05 14:20 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-06 20:52 -0700
Re: Could Forth be getting a bit of traction? Mux <Yvo.Zoer@gmail.com> - 2015-09-05 12:11 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-05 19:56 -0700
Re: Could Forth be getting a bit of traction? Greg <borota@gmail.com> - 2015-09-06 09:39 -0700
Re: Could Forth be getting a bit of traction? mhx@iae.nl - 2015-09-06 13:01 -0700
Re: Could Forth be getting a bit of traction? borota@gmail.com - 2015-09-06 18:48 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-06 19:43 -0700
Re: Could Forth be getting a bit of traction? borota@gmail.com - 2015-09-06 20:59 -0700
Re: Could Forth be getting a bit of traction? "WJ" <w_a_x_man@yahoo.com> - 2015-09-08 19:46 +0000
Re: Could Forth be getting a bit of traction? borota@gmail.com - 2015-09-08 13:28 -0700
Re: Could Forth be getting a bit of traction? jim.brakefield@ieee.org - 2015-09-08 17:27 -0700
Re: Could Forth be getting a bit of traction? Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-09 03:35 +0200
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-09-08 19:48 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-08 20:28 -0700
Re: Could Forth be getting a bit of traction? jim.brakefield@ieee.org - 2015-09-08 20:48 -0700
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-09-08 21:00 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-08 21:35 -0700
Re: Could Forth be getting a bit of traction? mhx@iae.nl - 2015-09-10 15:20 -0700
Re: Could Forth be getting a bit of traction? jim.brakefield@ieee.org - 2015-09-10 17:26 -0700
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-09-10 14:57 -1000
Re: Could Forth be getting a bit of traction? julian.fondren@endurance.com - 2015-09-10 20:47 -0700
Re: Could Forth be getting a bit of traction? mhx@iae.nl (Marcel Hendrix) - 2015-09-11 10:49 +0200
Re: Could Forth be getting a bit of traction? jim.brakefield@ieee.org - 2015-09-11 10:16 -0700
Re: Could Forth be getting a bit of traction? Ron Aaron <rambamist@gmail.com> - 2015-09-09 07:42 +0300
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-09-08 18:41 -0400
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-08 19:24 -0700
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-09-08 20:59 -1000
Re: Could Forth be getting a bit of traction? Greg <borota@gmail.com> - 2015-09-09 15:47 -0700
Re: Could Forth be getting a bit of traction? borota@gmail.com - 2015-09-11 08:15 -0700
Re: Could Forth be getting a bit of traction? visualforth@rocketmail.com - 2015-10-04 19:59 -0700
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-10-04 17:48 -1000
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-10-04 21:10 -0700
Re: Could Forth be getting a bit of traction? Roberto Waltman <usenet@rwaltman.com> - 2015-10-05 00:53 -0400
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-10-05 03:51 -0400
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-10-04 18:58 -1000
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-10-04 23:35 -0700
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-10-04 23:44 -0700
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-10-05 08:54 -1000
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-10-05 12:58 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-10-06 01:35 -0400
Re: Could Forth be getting a bit of traction? JUERGEN <epldfpga@aol.com> - 2015-10-06 02:58 -0700
Re: Could Forth be getting a bit of traction? Raimond Dragomir <raimond.dragomir@gmail.com> - 2015-10-06 04:05 -0700
Re: Could Forth be getting a bit of traction? Mark Wills <markwills1970@gmail.com> - 2015-10-06 04:22 -0700
Re: Could Forth be getting a bit of traction? JUERGEN <epldfpga@aol.com> - 2015-10-06 15:00 -0700
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-10-06 16:02 -0700
Re: Could Forth be getting a bit of traction? Ron Aaron <rambamist@gmail.com> - 2015-10-07 07:49 +0300
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-10-06 15:04 -0700
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-10-09 14:16 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-10-06 09:34 -0400
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-10-06 09:08 -1000
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-10-06 20:49 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-10-07 00:56 -0400
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-10-06 21:11 -1000
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-10-09 21:07 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-10-10 19:38 -0400
Re: Could Forth be getting a bit of traction? Paul Rubin <no.email@nospam.invalid> - 2015-10-10 20:46 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-10-11 01:16 -0400
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-10-10 22:50 -0700
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-10-04 21:21 -1000
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-10-05 08:26 -0700
Re: Could Forth be getting a bit of traction? Alfred Singlestone <vitonis@gmail.com> - 2015-10-06 07:13 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-10 00:12 -0700
Re: Could Forth be getting a bit of traction? humptydumpty <ouatubi@gmail.com> - 2015-09-08 11:48 -0700
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-09-08 20:55 -1000
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-09 02:28 -0700
Re: Could Forth be getting a bit of traction? november.nihal@gmail.com - 2015-09-09 03:36 -0700
Re: Could Forth be getting a bit of traction? Marek Brunda <marekb@phoenics.org> - 2015-09-09 03:59 -0700
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-09-09 07:34 -1000
Re: Could Forth be getting a bit of traction? jim.brakefield@ieee.org - 2015-09-09 12:32 -0700
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-10 17:10 -0700
Re: Could Forth be getting a bit of traction? "WJ" <w_a_x_man@yahoo.com> - 2015-09-09 18:59 +0000
Re: Could Forth be getting a bit of traction? Whammo <sidciavic@gmail.com> - 2015-09-09 12:28 -0700
structs/unions/records (was: Could Forth be getting a bit of traction?) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-09-09 07:10 +0000
Re: structs/unions/records (was: Could Forth be getting a bit of traction?) hughaguilar96@gmail.com - 2015-09-09 02:18 -0700
Re: structs/unions/records rickman <gnuarm@gmail.com> - 2015-09-09 23:27 -0400
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-06 23:18 -0700
Re: Could Forth be getting a bit of traction? awegel@arcor.de (Alexander Wegel) - 2015-09-07 12:57 +0200
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-07 09:55 -0700
Re: Could Forth be getting a bit of traction? "WJ" <w_a_x_man@yahoo.com> - 2015-09-07 18:45 +0000
Re: Could Forth be getting a bit of traction? awegel@arcor.de (Alexander Wegel) - 2015-09-08 00:13 +0200
Re: Could Forth be getting a bit of traction? Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-08 01:51 +0200
Re: Could Forth be getting a bit of traction? awegel@arcor.de (Alexander Wegel) - 2015-09-08 00:13 +0200
Re: Could Forth be getting a bit of traction? "WJ" <w_a_x_man@yahoo.com> - 2015-09-07 18:27 +0000
Re: Could Forth be getting a bit of traction? borota@gmail.com - 2015-09-07 12:23 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-09-07 16:14 -0400
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-07 17:39 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-09-08 01:39 -0400
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-09-05 03:12 -0400
Re: Could Forth be getting a bit of traction? foxaudioresearch@gmail.com - 2015-09-05 09:02 -0700
Re: Could Forth be getting a bit of traction? "WJ" <w_a_x_man@yahoo.com> - 2015-09-05 16:47 +0000
Re: Could Forth be getting a bit of traction? Alfred Singlestone <vitonis@gmail.com> - 2015-09-05 11:13 -0700
Re: Could Forth be getting a bit of traction? josv@planet.nl - 2015-09-01 12:37 -0700
Re: Could Forth be getting a bit of traction? Bernd Paysan <bernd.paysan@gmx.de> - 2015-09-01 22:02 +0200
Re: Could Forth be getting a bit of traction? Mux <Yvo.Zoer@gmail.com> - 2015-09-08 03:45 -0700
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-09-08 07:54 -1000
Re: Could Forth be getting a bit of traction? hughaguilar96@gmail.com - 2015-09-08 19:08 -0700
Re: Could Forth be getting a bit of traction? Mux <Yvo.Zoer@gmail.com> - 2015-09-09 15:00 -0700
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-09-09 23:18 -0400
Re: Could Forth be getting a bit of traction? p.lad.work@gmail.com - 2015-10-05 05:04 -0700
Re: Could Forth be getting a bit of traction? foxaudioresearch@gmail.com - 2015-10-05 06:39 -0700
Re: Could Forth be getting a bit of traction? Chris Curl <ccurl609@gmail.com> - 2015-10-05 18:44 -0700
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-10-05 17:47 -1000
Re: Could Forth be getting a bit of traction? Chris Curl <ccurl609@gmail.com> - 2015-10-05 21:58 -0700
Re: Could Forth be getting a bit of traction? Jason Damisch <jasondamisch@yahoo.com> - 2015-10-06 10:55 -0700
Re: Could Forth be getting a bit of traction? "Elizabeth D. Rather" <erather@forth.com> - 2015-10-06 09:13 -1000
Re: Could Forth be getting a bit of traction? rickman <gnuarm@gmail.com> - 2015-10-06 01:37 -0400
csiph-web