M2
M2 copied to clipboard
value of string terminating in semicolon
This somewhat surprised me. Shouldn't the value of a string terminating in ";" be null?
i1 : value "new HashTable from {}"
o1 = HashTable{}
o1 : HashTable
i2 : value "new HashTable from {};" -- I expected null, got hash table!
o2 = HashTable{}
o2 : HashTable
i3 : value "(new HashTable from {})"
o3 = HashTable{}
o3 : HashTable
i4 : value "(new HashTable from {};)" -- I expected null, got null
i5 :
Edit: here is a specific problem that this causes:
i5 : << last capture generateAssertions "12;"
i1 : assert( (12;) === 12 );
currentString:1:1:(3):[7]: error: assertion failed
it looks like it's intentional (cf the argument returnLastvalue of readeval). but I don't understand why, superficially it seems like a bug.
Could you point to a line? I'm not sure where in readeval you're referring to.