implicit assignments in functions

implicit assignments in functions - Сообщения

#1 Опубликовано: 01.06.2012 10:35:40
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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 Опубликовано: 01.06.2012 11:09:15
Oscar Campo

Oscar Campo

124 сообщений из 298 понравились пользователям.

Группа: Moderator

It would be very useful
#3 Опубликовано: 01.06.2012 11:09:47
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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 Опубликовано: 01.06.2012 13:47:00
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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 Опубликовано: 01.06.2012 19:28:31
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: 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 пользователям понравился этот пост
Davide Carpi 02.06.2012 08:23:00
#6 Опубликовано: 02.06.2012 01:44:19
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: 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!"
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений