close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 18 years ago

Closed 18 years ago

#481 closed defect (fixed)

Reassignation (:=) of a set element fails

Reported by: imendez Owned by: Víctor de Buen Remiro
Priority: normal Milestone:
Component: Kernel Version: 1.1.5
Severity: normal Keywords:
Cc:

Description

Hi, this code returns an error message:

Set f = 4, 3?;
Real f[1] := 2;

However, it works fine with brackets:

Set f = 4, 3?;
Real (f[1] := 2);

Regards.

Change History (6)

comment:1 Changed 18 years ago by Víctor de Buen Remiro

Owner: changed from danirus to Víctor de Buen Remiro

Thanks to report

comment:2 Changed 18 years ago by Víctor de Buen Remiro

Resolution: invalid
Status: newclosed

Syntax Tol works in this way and is nothing wrong in my opinion. Data types (Real, Serie, ...) are monary operators with the highest precedence. I don't know if this is a good design or not, but it is the only one we have.

System returns an error that helps you to understand what is wrong and, as you have written, you can broke precedence rules using parenthesis.

Then, where is the problem?

comment:3 Changed 18 years ago by imendez

Hello Víctor, I could understand that I had to put the brackets around the element I want to modify:

Set f = 4, 3?;
Real (f[1]) := 2;

But not around the whole expression... In previous versions of TOL, as you know, it was necessary. For example, this code didn't work time ago:

Real a = 4;
Real a := 4; This line used to return an error
Real (a := 4);
This line used to work right

You ask me what the problem is. The problem is tha, with the error message returned, a TOL new user couldn't never be able to write the code in a right way...

The error message is:

ERROR: [1] Número de argumentos insuficientes para Element (ó [ ] )

How could a novice user of TOL discover the solution?

If it's a syntactic problem and you think it mustn't be solved, all right, but at least I think that this example should be added to description of PutValue (:=).

Thanks.

comment:4 Changed 18 years ago by Víctor de Buen Remiro

Resolution: invalid
Status: closedreopened

comment:5 Changed 18 years ago by Víctor de Buen Remiro

I will treat to do something to enhance the behaviour in this situations but syntax questions are commonly difficult to solve without collateral effects.

comment:6 Changed 18 years ago by Víctor de Buen Remiro

bug_file_loc: http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000481
Resolution: fixed
Status: reopenedclosed

Sorry, I did not read the stupid message

ERROR: [1] Número de argumentos insuficientes para Element (ó [ ] )

This is a surprising message and it has allowed to me to debug the problem and it's already solved in HEAD and 1.1.5

A test has been added at

http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000481

Thank you very much for your perseverance

Note: See TracTickets for help on using tickets.