Search the web
Sign In
New User? Sign Up
forth200x
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
RfD: <BUILDS   Message List  
Reply | Forward Message #338 of 425 |
Re: Doing DOES>

--- In forth200x@yahoogroups.com, Hugh Aguilar <hughaguilar96@...> wrote:


> So far so good; this is just like a DOES> word. The problem comes with
multi-action words in which the programmer writes something like this:
>
> MY-DEFINER XXX &XXX XXX++ XXX--
>
> That is requiring the programmer to know all of the helper words that will be
generated and get them in the correct order. That shouldn't be his job. He
should just provide the single name XXX and let MY-DEFINER derive the helper
word names from the XXX by pasting on suffixes and prefixes as needed.
>

Yes that wouldn't work well, and I don't think it was Mitch,s intention. Since
Forth already uses prefixes to distinguish multiple actions, perhaps the
cleanest syntax would be

xt <prefix> ACTION <actor-name>

where ACTION associates an existing prefix with all future words defined by an
existing actor name.

Thus:

prefix TO

: VALUE ['] @ Actor: 0 , ;
' ! TO action VALUE





Thu Jul 9, 2009 11:20 am

brienjenny
Offline Offline
Send Email Send Email

Forward
Message #338 of 425 |
Expand Messages Author Sort by Date

Author ... Hugh Aguilar Note: This is changed to be an RfD rather than a CfV. Problem ... This works on a system in which code space and data space are...
Hugh Aguilar
hughaguilar96
Offline Send Email
Jun 29, 2009
10:35 pm

... I also recommend that you post this on comp.lang.forth, which is where the most thorough discussions are taking place. Cheers, Elizabeth -- ...
Elizabeth D Rather
erather
Offline Send Email
Jun 30, 2009
7:54 am

... No, that's not the solution. CREATE DOES> is standard, used by many programs and systems, and can't be changed. The solution is to add another word, e.g. ...
Bernd Paysan
berndpaysan
Offline Send Email
Jun 30, 2009
8:25 am

... The first appearance of BUFFER: that I know of was in my Open Boot implementation for Sun SPARCstations. I needed a convenient way to allocate...
Mitch Bradley
wmb@...
Send Email
Jun 30, 2009
1:22 pm

Your LABEL and BUFFER words aren't a solution because they break the existing code that uses CREATE to define a buffer of memory. A typical example would be. ...
Hugh Aguilar
hughaguilar96
Offline Send Email
Jun 30, 2009
11:25 pm

... In the first place, the word that Mitch and others are referring to is BUFFER: (it's been around since the 80's). It can coexist with CREATE ... No code...
Elizabeth D Rather
erather
Offline Send Email
Jul 1, 2009
7:38 am

... No, this wouldn't have to be changed. The code with CREATE still works, it just has a little more overhead than the BUFFER: solution. You only have to ...
Bernd Paysan
berndpaysan
Offline Send Email
Jul 1, 2009
7:41 am

It's not just the source code that is broken, it's the documentation too. Documentation that changes for life-critical applications has to be re-submitted -...
Richard Borrell
rgb2forth
Offline Send Email
Jul 1, 2009
8:21 am

... I like your idea. You would make it easier to build optimising Forth compilers, and also make the language make more sense. I believe the problem for...
jethomas3182
Offline Send Email
Jun 30, 2009
8:46 am

I apologize to Stephen Pelc for crediting him with the idea of introducing <BUILDS for use with DOES>, but also allowing CREATE to still be used in this manner...
Hugh Aguilar
hughaguilar96
Offline Send Email
Jul 2, 2009
4:00 pm

... That expectation does not agree with my expectation at all....
Mitch Bradley
wmb@...
Send Email
Jul 2, 2009
4:13 pm

... No, it is not okay. It appears that you have not been following the Forth200x process and have not read the current draft as your expectations seem to be...
Leon Wagner
leon_wagner
Offline Send Email
Jul 2, 2009
4:26 pm

... This is why it was mandated that DOES> is only guaranteed to work with CREATE, not with other defining words. Operationally, FORTH, Inc. and most other...
Elizabeth D Rather
erather
Offline Send Email
Jul 3, 2009
3:12 am

... Having spent years creating documentation for medical products I wholeheartedly agree with Elisabeth. The last thing the community needs is for Forth to...
Richard Borrell
rgb2forth
Offline Send Email
Jul 3, 2009
6:50 am

Posted by: "Hugh Aguilar" ... Rubbish. VFX treats children of CREATE as CONSTANTs. It can also optimise the DOES> clause such that when DOES> x + @ ; is the...
stephen@...
sfprem
Offline Send Email
Jul 3, 2009
6:41 am

... Of course there is. bigForth and gforth-fast detect CREATE in COMPILE, and compile a literal when it's a CREATE without DOES>. VFX Forth does the same ...
Bernd Paysan
berndpaysan
Offline Send Email
Jul 3, 2009
7:59 am

... Win32Forth also treats CREATEd words with no DOES> as literals ( and also objects, CONSTANTs and all types of variable ). The trick is CREATE sets the...
georgeahubert
Offline
Jul 5, 2009
12:35 pm

Having a word perform two disparate functions is bad design. Everybody knows that! The well-known proverb is: "Let the dictionary do the deciding" (see the...
Hugh Aguilar
hughaguilar96
Offline Send Email
Jul 5, 2009
8:04 am

... OK. Overloading CREATE was a bad idea from the beginning, but it's too late to fix the problem now and most compiler-writers have adapted to handle it. One...
jethomas3182
Offline Send Email
Jul 6, 2009
11:53 pm

... How do you figure CREATE is "overloaded"? Cheers, Elizabeth -- ================================================== Elizabeth D. Rather (US & Canada)...
Elizabeth D Rather
erather
Offline Send Email
Jul 6, 2009
11:59 pm

Here is my swag at the right way to do DOES>. I don't mean DOES> exactly, but rather the abstract thing that DOES> does. (How's that for an obtuse...
Mitch Bradley
wmb@...
Send Email
Jul 8, 2009
3:42 am

... align here <builder-stuff> ['] MY-ACTION ACTOR: ; ... This technique can also be varied to not work with addresses, but directly with the data (where it is...
Anton Ertl
anton@...
Send Email
Jul 8, 2009
1:28 pm

This looks interesting. I agree with what you say about DOES> being odd. In any case though, the action and the builder parts are going to execute at different...
Hugh Aguilar
hughaguilar96
Offline Send Email
Jul 9, 2009
2:20 am

... Yes that wouldn't work well, and I don't think it was Mitch,s intention. Since Forth already uses prefixes to distinguish multiple actions, perhaps the...
brienjenny
Offline Send Email
Jul 9, 2009
11:20 am

Mitch Bradley's idea was good, and your idea is also good. That's the funny thing about Forth programmers --- they are always coming up with good ideas. The...
Hugh Aguilar
hughaguilar96
Offline Send Email
Jul 10, 2009
2:36 am

... CREATE always had to work with ;CODE anyway, so whoever thunk of using an assembler call instruction to locate the code (at least in ITC Forths) did us all...
georgeahubert
Offline
Jul 7, 2009
9:05 am

... The innovation you mention was the work of Dean Sanderson, at FORTH, Inc., in the early 80's. Thank you for pointing out that CREATE hasn't changed and...
Elizabeth D Rather
erather
Offline Send Email
Jul 7, 2009
5:18 pm

... Stephen said no such thing! What I said was that <BUILDS ... DOES> may have some merit, but that Hugh has provided no numeric evidence for his assertions....
stephen@...
sfprem
Offline Send Email
Jul 1, 2009
3:55 pm

This is long and philosophical, I intended it primarily for Hugh Aguilar and posted it here in case it amuses someone. It does not need careful attention as...
Jonah Thomas
jethomas3182
Offline Send Email
Jul 3, 2009
2:38 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help