diff --git a/M2/Macaulay2/d/binding.d b/M2/Macaulay2/d/binding.d index 18236a2b1a..3e6bf58c3b 100644 --- a/M2/Macaulay2/d/binding.d +++ b/M2/Macaulay2/d/binding.d @@ -190,9 +190,9 @@ special(s:string,f:function(Token,TokenFile,int,bool):ParseTree,lprec:int,rprec: -- created below are all in the global dictionary. -- new operators must be: --- set up as an "actor" with "setup()" -- or not TODO explain +-- set up as an "actor" with "setup()" if they have nonstandard syntax +-- (without "setup()", M2 will just lookup a method) -- added to the export list in ../m2/exports.m2 --- added to the table binaryOperatorFunctions in ../m2/expressions.m2 -- added to the list of operators in the documentation node "operators" in ../packages/Macaulay2Doc/ov_language.m2 -- documented with a suitable headline, such as: -- "a unary operator" diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions.m2 index 0f33fc7054..015a2d808f 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions.m2 @@ -153,6 +153,7 @@ load "./functions/lift-doc.m2" load "./functions/liftable-doc.m2" load "./functions/locate-doc.m2" load "./functions/LU-doc.m2" +load "./functions/makeKeyword-doc.m2" load "./functions/map-doc.m2" load "./functions/max-doc.m2" load "./functions/maxPosition-doc.m2" diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/makeKeyword-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/makeKeyword-doc.m2 new file mode 100644 index 0000000000..4919053aa4 --- /dev/null +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/makeKeyword-doc.m2 @@ -0,0 +1,29 @@ +--- status: DRAFT +--- author(s): PZJ +--- notes: + +doc /// + Key + makeKeyword + (makeKeyword, String) + [makeKeyword, Precedence] + [makeKeyword, Syntax] + Headline + create a new keyword + Usage + makeKeyword s + Inputs + s: String + Precedence => {ZZ,Symbol} + Syntax => {List,Symbol} + Description + Text + Creates a new Keyword out of the input string. + The options specify the parsing behavior of the keyword. + Possible choices for @TT "Syntax"@ are: @TT "Binary"@, @TT "Prefix"@, @TT "Postfix"@ or @TT "{Binary,Prefix}"@. + If @TT "Precedence"@ is a @TT "Symbol"@, the precedence is set to the one of that symbol. + Example + makeKeyword("≺",Precedence => symbol <) + ZZ ≺ ZZ := (i,j) -> j==i+1 + 3≺4 +///