Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline mkraska  
#1 Posted : 26 February 2013 00:45:30(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,990
Germany

Was thanked: 1128 time(s) in 724 post(s)
I encountered the problem that I cannot use i as formal argument in function definitions. This is surprising to me, since i can be redefined in other situations (eg. by use as loop variable). May be this has been discussed earlier, but I don't find a hint.

Seems like one more oddity that is hard to explain. Or did I miss something?

mkraska attached the following image(s):
ifunction.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline omorr  
#2 Posted : 26 February 2013 11:29:34(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello Martin,

I remember this issue has been mentioned here more than few times. See for instance this one Treatment-of-imaginary-unit.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 2 users thanked omorr for this useful post.
on 26/02/2013(UTC),  on 26/02/2013(UTC)
Offline mkraska  
#3 Posted : 26 February 2013 12:42:53(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,990
Germany

Was thanked: 1128 time(s) in 724 post(s)
Originally Posted by: omorr Go to Quoted Post
Hello Martin,

I remember this issue has been mentioned here more than few times. See for instance this one Treatment-of-imaginary-unit.

Regards,
Radovan


Thank you, Radovan. I see that the resistance to i as formal parameter is hardwired in order to cover leaks in the optimization procedures. Would the formal parameters really be treated as local variables then life would be much easier.

In my handbook I frequently use i as variable name (loop counters, indices) in the hope that one day Andrey will find a clean solution that allows for unlimited use of i as variable name.

With a little criminal energy there is a workaround, see attachment. The trick is visible but not obvious and therefore cannot be recommended for regular use.

Martin



mkraska attached the following image(s):
ifunction2.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline omorr  
#4 Posted : 26 February 2013 13:14:41(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: mkraska Go to Quoted Post
With a little criminal energy there is a workaround, see attachment. The trick is visible but not obvious and therefore cannot be recommended for regular use.

The i. (dot after i - it can be seen by looking at the braces, they are a bit larger) is of the most troublesome and problematic issue to explain to beginners (is there an index or not? it looks like one, why it is not working as expected?? etc.) During all these years I am always having the same kind of questions and explanations to my students ,over and over, about "literal", "real one", "fictive", "dot as a part of variable name" and all kinds of errors in spite of endless repeating of that.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Users browsing this topic
Guest
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.