programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: An "alias" for a location defined by VALUE

From: Richard Owlett <rowlett_at_atlascomm.net>
Date: Tue, 15 Jan 2002 14:39:57 -0600

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

This archive was generated by hypermail 2.2.0 : Fri Nov 21 2008 - 03:04:21 PST