post-recording commit
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
export Y := \f.(\x.f (x x))(\x.f (x x))
|
||||
|
||||
export loop $r on (..$parameters) with ...$tail =0x5p129=> Y (\$r.
|
||||
bind_names (..$parameters) (...$tail)
|
||||
) ..$parameters
|
||||
|
||||
-- bind each of the names in the first argument as a parameter for the second argument
|
||||
bind_names ($name ..$rest) $payload =0x1p250=> \$name. bind_names (..$rest) $payload
|
||||
bind_names () (...$payload) =0x1p250=> ...$payload
|
||||
|
||||
export ...$prefix $ ...$suffix:1 =0x1p34=> ...$prefix (...$suffix)
|
||||
export ...$prefix |> $fn ..$suffix:1 =0x2p32=> $fn (...$prefix) ..$suffix
|
||||
|
||||
export (...$argv) => ...$body =0x2p129=> (bind_names (...$argv) (...$body))
|
||||
$name => ...$body =0x1p129=> (\$name. ...$body)
|
||||
3
examples/hello-world/main.orc
Normal file
3
examples/hello-world/main.orc
Normal file
@@ -0,0 +1,3 @@
|
||||
import std::print
|
||||
|
||||
main := print "Hello, world!\n" "goodbye"
|
||||
@@ -8,7 +8,7 @@ export loop $r on (..$parameters) with ...$tail =0x5p129=> Y (\$r.
|
||||
bind_names ($name ..$rest) $payload =0x1p250=> \$name. bind_names (..$rest) $payload
|
||||
bind_names () (...$payload) =0x1p250=> ...$payload
|
||||
|
||||
export ...$prefix $ ...$suffix:1 =0x1p34=> ...$prefix (...$suffix)
|
||||
export ...$prefix $ ...$suffix:1 =0x1p39=> ...$prefix (...$suffix)
|
||||
export ...$prefix |> $fn ..$suffix:1 =0x2p32=> $fn (...$prefix) ..$suffix
|
||||
|
||||
export (...$argv) => ...$body =0x2p129=> (bind_names (...$argv) (...$body))
|
||||
|
||||
@@ -11,16 +11,4 @@ export main := do{
|
||||
|> list::reduce 0 (a b) => a + b;
|
||||
cps print $ to_string sum ++ "\n";
|
||||
0
|
||||
}
|
||||
|
||||
--[
|
||||
export main := do{
|
||||
let n = 1;
|
||||
let acc = 1;
|
||||
loop r on (n acc) with (
|
||||
if n == 5
|
||||
then print acc
|
||||
else r (n + 1) (acc * 2)
|
||||
)
|
||||
}
|
||||
]--
|
||||
}
|
||||
Reference in New Issue
Block a user