Re: Adding functionality to ARM BASIC



On 28 Jan 2009 20:51:02 +0000
jgh@xxxxxxxxxxxxxxxxxx (Jonathan Graham Harston) wrote:

nntp@xxxxxxxx wrote:
Out of interest, what do people actually use EVAL for? The only
thing

Creating variables at run-time:

Yeah, we've done this one. There really should be a syntax for it, and
Steve has suggested one.

Reading hex values:
start%=EVAL("&"+st$)

Clearly this should be done by VAL. (It is in Brandy.)

An assembler that uses BASIC variables as labels.
equ base &100 creates a variable called "base"
movb r0,(r1)base uses EVAL to find out what "base" is

This is internal to the interpreter's workings, and an implementation
issue. Not something the user cars about.

Calculated function call:
IF key%>=&80 AND key%<&9F:A%=EVAL("FN_"+STR$~key%)

Eugh, this is horrible. Firstly, there's most likely a better way of
expressing this code, and secondly there are more elegant ways of
implementing this. (Such as first-class functions or function
pointers.)

For it's original purpose:
INPUT "Enter function to graph: "func$
...
PLOT 69,x%,EVAL(func$)

And you'd certainly want no software past a little personal script ever
doing this.

B.

.



Relevant Pages

  • Re: Adding functionality to ARM BASIC
    ... Rob Kendrick wrote: ... Yeah, we've done this one. ... There really should be a syntax for it, ... Steve has suggested one. ...
    (comp.sys.acorn.programmer)
  • Re: newbe about API
    ... sure...because the Intel encodings and prefixes for 16-bit and 32-bit ... know - from only looking at those instruction encodings - which way ... Hence, even with your great "size suffix" syntax, Intel's encodings ... But, yeah, I looked at your code, Herbert, and you employed something ...
    (alt.lang.asm)
  • Anger management
    ... "Is this the man with the gunmetal grey Land Rover for sale?" ... "Yes, I live at 129 Well Street, in Torrington. ... "When's a good time to catch you, Steve?" ... "Yeah," I said. ...
    (uk.sport.football.clubs.liverpool)
  • Re: "Syntax error in ALTER TABLE statement.", again...
    ... > Yeah, yeah, once again about this error... ... No matter the language used to send DDL commands to the db, ... syntax has to fit the db's DDL syntax. ... In Access (JET) dbs some ...
    (microsoft.public.access.queries)
  • [fw-wiz] RE: CERT vulnerability note VU# 539363
    ... > -- steve ... any sense of your normal traffic profile), ... avoided it for stability reasons at a newly-deployed site but it ... rules to adapt to its new syntax. ...
    (Firewall-Wizards)

Loading