implicit assignments in functions

implicit assignments in functions - Messages

#1 Posted: 6/1/2012 10:35:40 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Hi,

just an idea... implicit assignments for equations (f.e. in PHP is widely used)

implicit assignments


regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#2 Posted: 6/1/2012 11:09:15 AM
Oscar Campo

Oscar Campo

124 likes in 298 posts.

Group: Moderator

It would be very useful
#3 Posted: 6/1/2012 11:09:47 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello w3b5urf3r,

Some similar idea crossed my mind some time ago. But there might be a problem regarding this. SMath can have the same name for different functions differentiating in different number of arguments. Number of arguments is the way to use the right one. Therefore, if you say f(3) and f(3,2) these are calls to two different functions. How then to apply your idea about implicit assignments? Could this be possible, or confusing maybe?

I hope I made myself understood.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#4 Posted: 6/1/2012 1:47:00 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Hello omorr

I understand, you're right... I had not realized until now that functions have this behavior...

I have no idea, it seems that the two behaviors are completely in conflict; if so, I think that should be discriminating which of two options is more used / usable, and therefore should be abolished completely the possibility of developing the other option (provided that this does not involve a deep rewriting of the SMath code)...

I personally think that when you define a new function with the same name and different arguments, you have simply redefined the function (like any variable), but it's just my opinion


regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#5 Posted: 6/1/2012 7:28:31 PM
Andrey Ivashov

Andrey Ivashov

2269 likes in 3730 posts.

Group: Super Administrator

It's a very interesting idea! I'm serious! Thank you [USERLINK]w3b5urf3r_reloaded[/USERLINK].

Wrote

I personally think that when you define a new function with the same name and different arguments, you have simply redefined the function (like any variable), but it's just my opinion


Agree with you. So I don't see any conflict here.

I will think about possibility to implement this feature in nearest future.

Best regards, Andrey Ivashov.
1 users liked this post
Davide Carpi 6/2/2012 8:23:00 AM
#6 Posted: 6/2/2012 1:44:19 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Helo Andrey,

I am very glad that you are taking this into account . Now, it crossed my mind some other things. If I understood you well, you are thinking of changing SMath behavior about function naming. That might mean that there would be no f(x) and f(x,y) regarded as two different functions. We could use only one of them and It will depend which one was defined last and that would be used. Am I right? On the other hand, I suppose that there would be no more situation of having the same name of variable and function, actually "f" and "f()". If that is the case, I think it would make the things less complicated. I remember that you have had problems of how to use functions as function arguments. Now, it is a bit complicated. We can not simply put a function name, we must put some dummy arguments as well in order to distinguish which function was used. Just look at the Jacob() or roots() for instance. I suppose that if you forbid the same name of variables and functions, you could simply put the function name as the function argument without conflicting with other variables or functions, which would be less complicated - I think.

Hope that I was right about all of this.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
  • New Posts New Posts
  • No New Posts No New Posts