Rank: Newbie
Groups: Registered
Joined: 16/11/2013(UTC) Posts: 2 Location: Munich
|
Hello, I am new to smath and may probably have missed something relating to the syntax. However, the following result surprised me and I am quite curious why I get this result. remark: I use smath under linux (debian). al alberich attached the following image(s):
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,986 Was thanked: 1124 time(s) in 721 post(s)
|
Originally Posted by: alberich Hello,
I am new to smath and may probably have missed something relating to the syntax. However, the following result surprised me and I am quite curious why I get this result. remark: I use smath under linux (debian).
al Interesting question. I never used lists (systems) to make instruction blocks. As your example demonstrates, the entries in a list (as well as in matrices) are evaluated in reverse sequence. In the first loop iteration, z is not defined and stored symbolically in b[1;1, then z is set to 1 After leaving the loop, z has the value 9, which is substituted for z when you evaluate b. You see that if you hover with the mouse over the loop statement. If you reverse the entries, you get the expected behaviour. Normally you are supposed to use the line() function for instruction blocks. The elements are evaluated top-down and the block has the result of the last statement as return value. EDIT: It seems that there are severe operator spacing problems under linux. Between variable and array index there should be more space in order to distinguish such indices from text indices. Also, the := in the loop header look like = because the : is printed over the preceeding operator. You might experiment with the dpi settings. Edited by user 16 November 2013 12:42:16(UTC)
| Reason: Not specified File Attachment(s): line.sm (8kb) downloaded 152 time(s). mkraska attached the following image(s): |
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 16/11/2013(UTC) Posts: 2 Location: Munich
|
Thank you for the quick reply. al
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.