OK, let's start over. I think I introduced a 'red herring" in a previous
post by mentioning the trigger word "string" ;{
BACKGROUND: I am working on a 'problem' of a 'class' which I have solved
before.
OBJECTIVE: Learn more about Forth.
CAVEAT LECTOR: I do not care if my strategy is optimal, I pose explicit
questions.
Problem redefinition:
Preamble: any address is assumed to br in units of one CELL.
Minimum array subscript is 1.
Given an an array X(1) -> X(n), it is desired that ALPHA return the
value at X(1)
AND
BETA return the address of X(1)
Consider the following code fragment
: wierd_VALUE ( n -- )
HEADER POSTPONE (VALUE) 0 , /ALLOT ;
1000 wierd_VALUE ALPHA
: BETA ['] ALPHA ;
: GAMMA ['] ALPHA 1 CELLS + ;
QUESTIONs:
1. Does APLHA respond in all cases as a word defined by VALUE ?
2. Do BETA and GAMMA respond in all cases as words defined by VARIABLE
?
{ ignoring ' and ['] and anything else with state-smartnerss etc. ?
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Search the archives! Visit http://www.forth.com/search for details.
Received on Tue Jan 15 2002 - 12:47:57 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 08-Feb-2012. Archive updated nightly.