Files
orchid/examples/dummy_project/main.orc
Lawrence Bethlenfalvy 329dea72b7 Mainly worked on the rule matcher
Also fixed the name collector, and lambda parameters are no longer
resolved at parsing to support planned macro-based pattern matching.
The rule matcher clones a lot, the number of clones could be zero.
2022-08-06 18:12:51 +02:00

23 lines
600 B
Plaintext

-- import std::io::(println, out) -- imports
-- single word rule (alias)
greet =1=> (\name. printf out "Hello {}!\n" [name])
-- multi-word exported rule
export ;> $a =200=> (greet $a)
reeee := \$a.b
-- single-word exported rule
export main == (
print "What is your name?" >>
readln >>= \name.
greet name
)
export < $a ...$rest /> == (createElement (tok_to_str $a) [(props_carriage ...$rest)])
export (props_carriage $key = $value) == (tok_to_str $key) => $value
-- The broadest trait definition in existence
Foo == (Bar Baz)
-- default anyFoo = @T. @impl:(T (Bar Baz)). impl:(T Foo)