mirror of
https://github.com/nineties/planckforth
synced 2024-12-25 21:58:22 +01:00
Update example
This commit is contained in:
parent
c60b5dec5c
commit
74155f9994
3 changed files with 14 additions and 5 deletions
17
README.md
17
README.md
|
@ -29,17 +29,24 @@ kHtketkltkltkotk tkWtkotkrtkltkdtk!tk:k0-tQ
|
|||
After bootstrapping by `bootstrap.fs`, it looks like this.
|
||||
|
||||
```
|
||||
$ cat bootstrap.fs - | ./planck
|
||||
$ ./planck < bootstrap.fs --i386-linux
|
||||
Ready.
|
||||
." Hello World!" cr
|
||||
```
|
||||
|
||||
Other examples.
|
||||
The option `--i386-linux` is to specify OS and hardware for dynamic
|
||||
code generation by `bootstrap.fs`.
|
||||
It is not necessay in case of implementations by other languages.
|
||||
|
||||
|
||||
`bootstrap.fs` also takes a file as an input like this.
|
||||
|
||||
```
|
||||
$ cat bootstrap.fs - | ./planck
|
||||
123 456 + . cr
|
||||
$ cat example/fib.fs
|
||||
: fib dup 2 < unless 1- dup recurse swap 1- recurse + then ;
|
||||
30 fib . cr
|
||||
38 fib . cr
|
||||
$ ./planck < bootstrap.fs --i386-linux example/fib.fs
|
||||
39088169
|
||||
```
|
||||
|
||||
# Builtin Words
|
||||
|
|
2
example/fib.fs
Normal file
2
example/fib.fs
Normal file
|
@ -0,0 +1,2 @@
|
|||
: fib dup 2 < unless 1- dup recurse swap 1- recurse + then ;
|
||||
38 fib . cr
|
Loading…
Reference in a new issue