Last active
May 23, 2018 18:42
-
-
Save odanoburu/d4ddb0919b63facaa3376366a0946e64 to your computer and use it in GitHub Desktop.
trying to understand how these two forms of `pre` work in GF
This file contains 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
resource PhonoPor = open Prelude in { | |
-- the implementation is wrong, the point is the use of `pre` | |
oper | |
a : pattern Str = #("a") ; | |
o : pattern Str = #("o") ; | |
elisEm : Str ; | |
{-- doesn't work, complains about "a" not being a pattern | |
elisEm = pre {"em" ; "na" / "a" ; "no" / "o"} ; | |
but this works: --} | |
elisEm = pre {"em" ; "na" / a ; "no" / o} ; | |
{-- this works | |
elisEm = pre { | |
"a" => "na" ; | |
"o" => "no" ; | |
_ => "em" | |
} ; | |
-- and so does this | |
elisEm = pre { | |
a => "na" ; | |
o => "no" ; | |
_ => "em" | |
} ; | |
--} | |
} ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment