From: Lucian S. <luc...@gm...> - 2013-10-21 22:10:49
|
As far as the infix goes, I think I would just use square brackets everywhere. Parsers can distinguish between the two cases by whether or not there's a name in front of the first bracket: x = [a, b, c] vs. x = y[a] As far as the other functions, the L3 parser's current approach is to accept a variety of synonyms for several functions, so I'd accept any reasonable synonym: "determinant" and "det" would both probably be fine. I would be fine adding sum, etc. to the L3v2 core, too. We should probably have a conversation again about what specifically people would like to add. -Lucian On Mon, Oct 21, 2013 at 3:02 PM, Chris J. Myers <my...@ec...> wrote: > Hi, > > While not strictly part of the arrays specification, I was trying to figure how the extended mathML subset would be mapped to the string parser for mathML. Here are my observations and suggestions. > > 1) vector - used to express a vector explicitly in math. Suggest braces to group and commas to separate elements. > > Ex. { 1, 2, 3 } > > Note elements do not need to be constants but could be math expressions. > > 2) matrix/matrixrow - used to express a matrix explicitly in math. Natural extension of the above with braces and commas. > > Ex. { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } } > > 3) selector - used to access an element in an array. Use square brackets. > > Ex. x[i+1] > > Note if x is 2-dimensional, this will return a vector composed of the first row. > > 4) determinant, transpose, vectorproduct, scalarproduct, and outerproduct - seems like function call simplest approach. Open to suggestions on names of functions. > > det(A) > trans(A) > vectorProd(A,B) > scalarProd(A,B) > outerProd(A,B) > > 5) sum, product, forall, exists - these were in the specification be looking at them more closely, they are not really just used for arrays. They use bvar, lowerlimit, uplimit, interval, and condition to setup an operation. I think sum and product should be candidates for a general MathML extension to the core. The forall and exists could also be such candidates, but they will be rather expensive to actually evaluate. > > Comments? > > Chris > |