grzegorzmazur / yacas

Computer calculations made easy
http://www.yacas.org
GNU Lesser General Public License v2.1
130 stars 24 forks source link

Unasigned list element is zero. #316

Closed Isomorph70 closed 4 years ago

Isomorph70 commented 4 years ago

I would expect an unassigned list element to be unassigned. So a[i] would return a[i], if a and i is unassigned.

In> i Out> i In> a Out> a In> a[i] Out> 0 In> TraceExp(a[i]) Enter a[i] Enter a Leave a Enter i Leave i Enter True Leave True Enter 0 Leave 0 Leave 0 Out> 0

Isomorph70 commented 4 years ago

Verify(Type(a[i]),"Nth")

Seem like a[k] work fin.

grzegorzmazur commented 4 years ago

Hmmm... Curiously, seems to work for me just fine:

In> a[i]
Out> a[i]

I've checked both 1.9.1 release and current master.

Haven't got foggiest idea what fails in your case :(

Isomorph70 commented 4 years ago

Hmm, okay I fucked up. Looking through my history file I found: % /: {Deriv(x)a[i] <-- 0};

I tried to make a local rule, but did not work as intended.