|
From: Majzoub, E. <eri...@um...> - 2026-01-08 23:34:30
|
Thank you for all your replies. My initial implementation was ad hoc. I think I can do what I want more cleanly without defining functions the way I was. I’ll work it out… Sent from my iPhone On Jan 8, 2026, at 4:19 PM, Stavros Macrakis <mac...@gm...> wrote: WARNING: This message has originated from an External Source. This may be a phishing expedition that can result in unauthorized access to our IT System. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. On Thu, Jan 8, 2026 at 2:01 PM Robert Dodier <rob...@gm...<mailto:rob...@gm...>> wrote: ... Looks like the larger issue here is that Maxima functions can't have subscripted variables as formal arguments (only simple symbols are allowed). Whether there are display properties doesn't change that. I think I have experimented with allowing subscripted variables as formal arguments, and if I recall correctly, it is not too complicated to make it happen. (Or maybe it is -- I don't have a clear memory about it.) But then there are problems with interpreting variations such as: function foo is declared as foo(A[k]) := ..., what if I say A[j] or A[1] or A[k + 1] in the function body? What if I then say k: 100, what happens to the formal argument? Or foo(A[1]) := ..., does A[2] have any special meaning? Etc. As Fateman points out, no common programming languages support subscripted formal variables, for all the good reasons you give. If it's just the name that is wanted, users can use other conventions if their variables have conventional names, e.g., phi_x, phi_y, phi_z. If there is some interesting semantics attached to the subscripted formal variable, I'd like to know what it is. _______________________________________________ Maxima-discuss mailing list Max...@li... https://lists.sourceforge.net/lists/listinfo/maxima-discuss |