Commit graph

8 commits

Author SHA1 Message Date
aa6346eafa tokenizer: Add backtick delimited strings
This is useful when writing strings that contain a lot of backslashes,
e.g. in regular expressions.
2023-11-07 21:45:27 +01:00
1cff056e53 Implement symbol values 2023-03-23 23:44:54 +01:00
6056e3a450 Implement pairs
Pairs are 2-tuples of values that are constructed and matched with the `::`
operator. They can also be matched with a `:` operator, the LHS is an
expression then, the pair will then only match, if the LHS matches the
result of that expression.

Pairs should be useful to do something similar what sum types / tagged
unions do in statically typed languages, e.g. you could write something
like:

    some := (symbol) # Somthing that creates a unique value
    filter-map := {
      _ [] -> []
      f [x ~xs] ->
        {
          some:y -> [y ~(filter-map f xs)]
          nil -> filter-map f xs
        } (f x)
    }
    filter-map {
      x?even -> some :: (* x 10)
      _ -> nil
    } some-list
2023-03-22 23:54:03 +01:00
3aabadbf6d Switch to CMake 2022-09-16 23:04:20 +02:00
e61caea2ff README: Fix typos 2022-07-27 23:48:44 +02:00
70c3d6e3e4 README: Fix spelling mistakes 2022-04-15 17:13:30 +02:00
c9a935b161 Support assigning into dictionaries
You can now set keys in dictionaries to a value. If a key in a key path is
missing, we automatically create an empty dictionary. Otherwise setting
deeply nested keys becomes annoying.
2022-01-15 23:09:24 +01:00
2162b8b580 Add a README
This roughly describes the syntax and semantics of the language
2022-01-14 23:25:57 +01:00