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
load: "examples/html.atomo" | |
load: "examples/web.hs" | |
Demo = Website clone | |
Demo index := | |
HTML new (do: { | |
doctype | |
html: { | |
head: { |
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
v match: (b: <self>) := | |
if: b contents empty? then: { @no-match } else: { es = b contents; | |
[p, e] = es head targets; | |
match = (p as: Pattern) matches?: v; | |
if: (match == @no) then: { v match: (Block new: es tail in: b scope) } else: { @(yes: obj) = match; | |
obj join: (Block new: [e] in: b scope) } } |
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
$ atomo | |
> load: "prelude/units.atomo" | |
@ok | |
> p = Timer do: { "hi!" print } every: 5 seconds | |
<process 92> | |
> hi! | |
hi! | |
hi! | |
hi! | |
hi! |
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
atomo $ atomo | |
> { 1 -> 2 * 3 } | |
{ (1 -> 2) * 3 } | |
> operator right -> | |
@ok | |
> { 1 -> 2 * 3 } | |
{ 1 -> (2 * 3) } | |
> |
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
> { [a, @+] -> 0 } contents head targets head as: Pattern | |
<pattern [a, @+]> | |
> { [a, @+] -> 0 } contents head targets head (as: Pattern) matches?: [1, 2] | |
@no | |
> { [a, @+] -> 0 } contents head targets head (as: Pattern) matches?: [1, @+] | |
@(yes: <object>) | |
> @(yes: o) = { [a, @+] -> 0 } contents head targets head (as: Pattern) matches?: [1, @+] | |
@(yes: <object>) | |
> o a | |
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
atomo $ atomo examples/error.atomo | |
traceback: | |
"examples/error.atomo" (line 6, column 1) | |
{ a print } call | |
... internal ... | |
"examples/error.atomo" (line 6, column 3) | |
a print | |
"examples/error.atomo" (line 6, column 3) | |
a | |
"examples/error.atomo" (line 1, column 6) |
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
alex@alex-laptop:~/the$ the | |
> [] includes?: _ := False | |
@defined | |
> (xs: List) includes?: y := if: (xs (take: y length) == y) then: { True } else: { xs tail includes?: y } | |
@defined | |
> [1, 2, 3, 4, 5] includes?: [2, 3] | |
True | |
> [1, 2, 3, 4, 5] includes?: [2, 4] | |
False | |
> "restaurant" includes?: "aura" |
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 = |
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
#title:{The} | |
hello! | |
#bold:{Hello, there. #bold:{My name is Inigo Monyoya}.} | |
goodbye! | |
#interaction:({ | |
1 + 1 |