Menu

#2865 Use exp as a list

None
closed
nobody
2
2015-01-07
2014-12-23
Ricardo
No

Use exp as a list should work like the rest of the words.

Egg:

/* example with word expr (not exp) */
expr:makelist(1,3);
expr[1]:5;
print(expr);
/* prints [5,1,1] */

/* example with word exp */
exp:makelist(1,3);
exp[1]:5;
print(exp);
/* prints [1,1,1]
   the first element should be 5, but it was 1! */

exp is used as function exponential, if it cannot be used as a list, then a message error should be printed when someone assigned a list to it.

Related

Wiki: 5.36.0

Discussion

  • Stavros Macrakis

    Thank you for reporting this bug.

    More generally, it turns out that for any name which has both a noun and a verb form, name[i]:val assigns to the verb symbol, not the noun symbol. This is a bug.

     
  • Robert Dodier

    Robert Dodier - 2015-01-07

    Fixed by commit [6b5fa46], Thanks for pointing it out. Closing this report.

     
  • Robert Dodier

    Robert Dodier - 2015-01-07
    • labels: --> array, noun/verb
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,7 @@
     Use exp as a list should work like the rest of the words.
    
     Egg:
    +~~~~
     /* example with word expr (not exp) */
     expr:makelist(1,3);
     expr[1]:5;
    @@ -13,5 +14,6 @@
     print(exp);
     /* prints [1,1,1]
        the first element should be 5, but it was 1! */
    +~~~~
    
     exp is used as function exponential, if it cannot be used as a list, then a message error should be printed when someone assigned a list to it.
    
    • status: open --> closed
     

Log in to post a comment.