This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ( useful things ) | |
| : dictionary.find/xt ( string:name - xt ) find [ @d->xt ] [ drop #0 ] if ; | |
| : getc:internal ( -c ) &getc 2 + @ do ; | |
| : __$ keepString 1 , , &dictionary.find/xt , ; parsing | |
| ( keymap ) | |
| 9 variable: prefix:CHAR | |
| create prefix:TABLE 256 allot | |
| ( We will lookup the keymap by name, to allow for per-application maps ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 9 variable: prefix:CHAR | |
| create prefix:TABLE | |
| 256 allot | |
| : getc:internal ( -c ) &getc 2 + @ do ; | |
| [ dup @prefix:CHAR == | |
| [ drop getc:internal | |
| "prefix:TABLE" find drop @d->xt + @ dup 0 <> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| needs struct' | |
| with struct' | |
| chain: binding' | |
| { | |
| 1 field .link | |
| 1 field .label | |
| 1 field .xt | |
| } bind | |
| variables| prefix lastbinding | | |
| : getc:internal ( -c ) &getc 2 + @ do ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| : header' here @last' , !last' &.word , here 2 + , , ; | |
| : :' getc dup putc header' 0 , 0 , ]] ; | |
| variable c | |
| : find' ( c-af ) !c last' repeat @ dup 0; 3 + @ @c = dup if; drop again ; | |
| : d'' ( "-a) getc dup putc find' drop ; | |
| : pair ( h-aa ) dup @d->xt swap @d->class ; | |
| : start -1 repeat getc dup putc find' [ pair do ] ifTrue 0; again ; | |
| :' a 1 putn ; | |
| :' b 2 putn ; | |
| :' c drop 0 ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| needs struct' | |
| with struct' | |
| : clone' ( a-a ) here 2dup swap size dup push allot pop copy ; | |
| { 2 fields .name .personal-dict } user | |
| : ;parse ( "-$ ) '; accept tib keepString ; | |
| : name: ( a"- ) ;parse swap .name ! ; | |
| user luke | |
| luke name: Luke Parrish; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| needs decimal' | |
| with decimal' | |
| : sqr ( n-n ) dup * ; | |
| 3 elements i j sum | |
| 1 !i 1 !j 0 !sum | |
| 8 !scale | |
| : // ( nn-n ) push 100000000 * pop / ; | |
| : pi_series ( -) repeat @j @i // @sum + !sum 4 @sum * yield @i 2 + !i @j -1 * !j again ; | |
| 3 elements s0 s1 s2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ( generator ) | |
| {{ | |
| : xt, ( - ) 1 , @last @d->xt , ; | |
| ---reveal--- | |
| : yield ( - ) 1 , here 5 + , xt, [ :is ] , 9 , xt, [ :devector ] , ; | |
| compile-only | |
| }} | |
| : foo ( - ) "State one" puts yield | |
| "State two" puts ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import IO | |
| -- IO playground | |
| intro :: String | |
| intro = "Hello, welcome to the playground." | |
| prompt = "\n->" | |
| -- | |
| quit :: IO () | |
| quit = do putStr "\nGoodbye." | |
| loop :: IO () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Idea: Digital commodity that acts as a source of credit and currency exchange. | |
| Bitcoin already provides a good way of creating a chain of digital transactions that can't easily be faked. This kind of transaction could be tied to something more elaborate. Among the possibilities, a distributed system for generating currency in a manner that is similar to a loan against collateral. | |
| 1. Alice generates a hard hashes against genesis block containing her public key. | |
| 2. Bob (and everyone) verifies that they are indeed hard and against the genesis block. | |
| 3. Alice sends Claire a transaction signed with her public key. | |
| 4. Bob verifies that the transaction is signed by someone with Alice's (i.e. the hard hash solver's) public key. | |
| So far, I'm describing bitcoin. However additional rules can be added to enable conversions like this: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir ~/bzr | |
| cd ~/bzr | |
| bzr branch lp:retro-language | |
| mkdir ~/github | |
| mkdir ~/github/retro-language | |
| cd ~/github/retro-language | |
| git init | |
| bzr fast-export --plain ~/bzr/retro-language/ | git fast-import | |
| git checkout master | |
| git remote add origin https://github.com/lsparrish/retro-language.git |