home .. forth .. colorforth mail list archive ..

Re: [colorforth] objects and forth


--- On Thu, 2/5/09, Lon <lonman@xxxxxxxxxxxxxx> wrote:


> Catching up on my email... this has been an interesting
> thread on programming ("paradigms"?). It seems a
> lot of the problems in mainstream programming don't even
> arise in Forth. 

'Calligraphy and Dictation' paradigm vs. 'Plot and Narration'

This is why they replace 'label X' and 'goto X' with '{' and '}'

Only now you still have goto statments only now you can't tell which label you are going to(Duff's device).

It the whole  'If you can't see it then it doesn't exist' thinking.

That is why they like this
---
: 10fib 55 . ;
: 10fib 34 . 10fib ;
: 10fib 21 . 10fib ;
: 10fib 13 . 10fib ;
: 10fib  8 . 10fib ;
: 10fib  5 . 10fib ;
: 10fib  3 . 10fib ;
: 10fib  2 . 10fib ;
: 10fib  1 . 10fib ;
: 10fib  1 . 10fib ;
---21
better than this

---
: floop DUP 34 < IF OVER + DUP . SWAP RECURSE THEN ;
: 10fib 0 1 floop DROP DROP ;
--- 16
becouse the fist version used only 1 label and the second version used 2.
The fact that the first one used 21 labels and the 16 labels, and they defined 10 and 2.
 
> And the ways they are moving to fix these
> problems seem to be moving towards forth philosophy - it is
> like they are creating "forth", backwards. I

That is because you can't tell the diffrance between a dictationist and a narrator.

They are starting where forth ends but that is the only over lap.


> and lots more... closures? - kind fuzzy on what they are,
> but they seem to be a non-issue in Forth.  

You know the diffrance between 'date stack' and 'local variables', it the same between the 'frame stack' and 'closures'('local frames')

Since forth does use 'local variables' we don't need 'local local variables'

Unless of course you are talking about 'anonymous functions' or 'function objects'.
h.com


      

---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com