|
From: <al...@al...> - 2007-06-13 09:03:39
|
Hi.
David Boucher wrote:
> 1. I come back on the functions' call.
>
> At the moment, if I enter x(2+x), it is understood as x*(2+x), also x
> (x+2) tells the same thing.
>
> Gustavo, you wanted that sin(x) is a function call. With the new
> parser, I can propose this :
>
> f(x) calls the function f with the argument x
>
> and f (x) is the product of f by x.
>
> This needs one more line in the parser grammar, so not difficult to
> implement.
>
> To forbid f (x) as a product would be more difficult for me (and I'm
> lazy to work on the parser...).
Seems ok, for me.
> 2. Alberto, we discussed on things that don't work with the actual
> parser.
>
> 3{1, 2, 3} gives the result {3, 6, 9} and the idea of 3{0} cannot be
> implemented. When we talked about that, there was a big error (I didn't
> know about it...) in the parser around product precedence. This error
> is solved but I lost this little grammar.
>
> At the moment, I have the function fill[3, 0] that returns {0, 0, 0}.
>
> I wanted to replace 3{0} by 3#{0}, but it generates many conflicts in
> the grammar just because #{vector} returns the size of the vector and
> 3#{vector} by default returns 3 times the size of the vector. So,
> conflict with 3#{0} which ask for something different.
I think to maintain the fill and not add too much syntax is a good idea.
> 3. I have also a difficulty with matrices. It is because of the product
> again.
>
> What's the sense of |1|2|3| ?
>
> Is it one matrix with one item equal to 1*|2|*3, which is |6| ? So we
> get ||6||.
>
> Or is it |1| * 2 * |3|, that is |6| ?
>
> The problem is that we cannot distinguish inside and outside of a
> matrix.
>
> To solve this, are you agree me to change || by {} ?
>
> It needs {2, 3} to be a single row matrix and also a vector, but this
> doesn't seem problematic.
>
> A second possibility is to remove the element matrix from NumExp and
> consider that a matrix is just a vector of vectors. Mathematica works
> like this. Maple is near of this idea too.
The only reason I like |...| is for multiple lines:
|1,2,3;4,5,6;7,8,9|
But if we change for
{1,2,3;4,5,6;7,8,9}
it seems nice as well.
I know we can write
{{1,2,3},{4,5,6},{7,8,9}},
but it has too much syntax.
> 4. I don't want to start a new war between i or j for the complex
> sqrt(-1)
>
> But when I make a loop, my counter is very often i or j. So, could we
> change i/j by I/J ?
I understand your motivation but I think to maintain i and j is better.
But if Gustavo agrees to change, no problem with me ;)
> 5. I wanted the range operator to be .. instead of ...
>
> And the product makes it difficult.
>
> Here is an example 3..::a , is it 3 * (..::a) or 3 .. (::a) ?
>
> So we have again ... for the range operator.
>
> But we have another possibility, we could have 3..::a that is
> 3 * (..::a) and if we really want the range, we could enter 3.. ::a
>
> So if .. and :: are separated by a space we have the range operator and
> if they are concatenated, they make part of the variable.
Ok, now I remember why I used '...' and not '..'
I think it is better to have really different symbols to remove confusions.
Cheers
Alberto
--
Alberto Simões - Departamento de Informática - Universidade do Minho
Campus de Gualtar - 4710-057 Braga - Portugal
|