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
(b: Block) in-scope := | |
Object clone do: { | |
delegates-to: b | |
call := b scope do: b | |
call: vs := b scope do: b with: vs | |
} |
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 The.Haskell | |
load = do | |
"(x: Object) clone" =: do | |
Reference r <- getSymbol "x" | |
proto <- newProto $ \p -> p | |
{ vpDelegates = [r] | |
} | |
return (Reference proto) |
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
(b: Block) key: (v: Object) := { | |
find = { l | | |
l match: { | |
[] -> @nothing | |
(e . es) -> | |
if: (e values head evaluate == v) | |
then: { @(ok: (e values (at: 1) evaluate)) } | |
else: { find call: [es] } | |
} | |
} |
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
HTML = Object clone | |
Association = Object clone | |
a -> b := Association clone do: { from = a; to = b } | |
Self-Closing = ["base", "meta", "link", "hr", "br", "param", "img", "area", "input", "col", "frame"] | |
-- creating elements with no content | |
-- keyword dispatch adds attributes |
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
$ the | |
> foo := dispatch sender x | |
> foo | |
message not understood: (<reference> x) | |
> x = 0 | |
> foo | |
0 | |
> { x = 42; foo } call | |
42 | |
> x |
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
"writan to the terminal" print | |
with-output-to: "foo.txt" do: { | |
"writan to foo.txt" print | |
} |
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
val ensuring: p do: b := { | |
res = b call: [val] | |
p call: [val] | |
res | |
} call | |
with-output-to: (fn: String) do: b := | |
Port (new: fn) ensuring: @close do: { file | | |
with-input-from: file do: b | |
} |
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
#title:{The} | |
hello! | |
#bold:{Hello, there. #bold:{My name is Inigo Monyoya}.} | |
goodbye! | |
#interaction:({ | |
1 + 1 |
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
module A.AutoFlow where | |
import Data.Char (isSpace) | |
import Text.HTML.TagSoup | |
autoFlow :: String -> String | |
autoFlow = renderTags . autoFlow' False . canonicalizeTags . parseTags | |
where | |
autoFlow' open [] | |
| open = [TagClose "p"] |
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 Data.Int | |
import Data.Time.Clock.POSIX | |
import LLVM.Core | |
import LLVM.ExecutionEngine | |
import System.Environment | |
main :: IO () | |
main = do | |
as <- getArgs | |
let num = |