I was trying to make an overload of function that I have created on GF, but after using the overload function I keep getting this error message.
Am I using this function of GF incorrectly or is there is any new update to this functionality.
Here is what I was trying to do
Sentence = sentence(mkN(“random”));
oper
sentence:overload {
sentence:N-> Utt =
\noun->
mkUtt(mkNP(noun));
sentence:V-> Utt =
\ verb->
mkutt(mkImp(mkV2(verb)));
};
Thank you~
Weird unicode characters
There are a lot of things wrong in this sample. First of all, it seems like you have written it in a word processor instead of a text editor, because the characters are not what they are supposed to be. For instance,
:
is the real colon, and your code snippet has:
, which is a different Unicode codepoint. Look at them side by side:The solution to this problem is to program in a text editor (like Atom or Sublime) or a programming IDE (like VS code), not in a word processor. Many editors don't have a syntax highlighting for GF, but you can see in this video how to use Haskell mode instead.
Actual problem
Now let's suppose we fixed the characters, then we have this.
Now we get the error you describe. The solution is to change the first
:
to a=
, like this:Working version of the whole
As Paula said, your example is just fragments. Here's a minimal fully working version.
And here's a concrete, with all the weird Unicode characters swapped out for actual characters. I also fixed the
mkImp
instance forV2
: if you see here in the synopsis, there's nomkImp
instance for a singleV2
, it's eitherV
orV2
andNP
.