Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ Forth.js ] Run Forth words code on your web page

199 views
Skip to first unread message

jimmyscratchlab jimmyscratchlab

unread,
Nov 2, 2012, 5:25:04 PM11/2/12
to
You can download demo page form http://forthjs.googlecode.com/files/forthjstest.zip

<p>9*9:</p>
<p class="forth" forthcode=": x 9 for cr r@ 9 for dup r@ * 2 .r space next drop next ; x">nil</p>
<p>fib 1:</p>
<p class="forth" forthcode=" : fib1 1 1 begin over . swap over + dup 10000 > until 2drop ; fib1">nil</p>
<p>fib 2:</p>
<p class="forth" forthcode=" fib2 ">nil</p>

Mark Wills

unread,
Nov 2, 2012, 5:49:49 PM11/2/12
to
On Nov 2, 9:25 pm, jimmyscratchlab jimmyscratchlab
<jimmyscratch...@gmail.com> wrote:
> You can download demo page formhttp://forthjs.googlecode.com/files/forthjstest.zip
This is very nice. Is there any English documentation? The JavaScript
is unreadable as written. It would be nice to get some docs. I'm sure
I could use it.

jimmyscratchlab jimmyscratchlab

unread,
Nov 9, 2012, 10:26:36 AM11/9/12
to
M.R.W Wills於 2012年11月3日星期六UTC+8上午5時49分50秒寫道:
> On Nov 2, 9:25 pm, jimmyscratchlab jimmyscratchlab
>
> <jimmyscratch...@gmail.com> wrote:
>
> > You can download demo page formhttp://forthjs.googlecode.com/files/forthjstest.zip
http://forthjs.googlecode.com/files/forthjstest.zip
I update it.
This demo page is a very simple document.

jimmyscratchlab jimmyscratchlab

unread,
Nov 20, 2012, 4:12:41 PM11/20/12
to
Idea of OOP in the Forth.js

class Vehicle weight power travelon
instance Vehicle MyBike
20 to MyBike.weight
new MyCar
2000 MyCar price
MyCar.price
1000 +to MyCar.price
: move bra bra bra ;
assign move MyCar.move
:method MyCar.stop bra bra bra ;

jimmyscratchlab jimmyscratchlab

unread,
Nov 21, 2012, 1:43:05 PM11/21/12
to
How to use Forth.js OOP words
http://jimmyscratchlab.blogspot.tw/2012/11/forthjs-oop.html

<p class="forth" forthcode=' .( (Test1 define class ) ) class Vehicle weight power travelon end_class see Vehicle '>nil</p>

(Test1 define class )
Scanning Vehicle
(000113) doInstanceAllAttr
(000114) weight
(000115) power
(000116) travelon
(000117) exit

jimmyscratchlab jimmyscratchlab於 2012年11月21日星期三UTC+8上午5時12分41秒寫道:
0 new messages