[GiNaC-devel] assignments in ginsh

Vladimir V. Kisil V.Kisil at leeds.ac.uk
Wed Jan 1 11:22:57 CET 2025


	Dear Richard,

	I feel that the earlier situation may be indeed more natural
  within ginsh.  It just needs to be sufficiently documented as in your
  email. 

  Happy New 2025 Year to everyone!

  Vladimir
-- 
Vladimir V. Kisil                  http://v-v-kisil.scienceontheweb.net
  Book:      Geometry of Mobius Maps       https://doi.org/10.1142/p835
  Soft:      Geometry of cycles         http://moebinv.sourceforge.net/
  Jupyter notebooks:        https://github.com/vvkisil?tab=repositories
>>>>> On Tue, 31 Dec 2024 19:18:14 +0100, "Richard B. Kreckel" <kreckel at in.terlu.de> said:
    RK> Hi,

    RK> The behavior of ginsh w.r.t. recursive variable assignment has
    RK> silently changed in GiNaC 1.4.4 (eaa0370a). Before, we got:
    >> a=3+x: x=2: a;
    RK> 5

    RK> Now, we get:
    >> a=3+x: x=2: a;
    RK> 3+x

    RK> It may be worth pointing out that in both cases, one gets:
    >> x=2: a=3+x: a;
    RK> 5

    RK> The old behavior can be easily restored (patch attached). Should
    RK> we?

    RK> Pros: ----- Ginsh isn't a real programming language - it has a
    RK> global namespace without scoping. Under these circumstances, it
    RK> seems natural to think of assignments as occurring in every
    RK> variable defined before and after.  (There is even an example in
    RK> the tutorial which is now wrong; search for "x=2".)

    RK> Cons: ----- This is not how it works in C++. There, we have: ex
    RK> x = symbol("x"); ex a = 3+x; x = 2; cout << a << endl; // prints
    RK> 3+x, not 5

    RK> I am inclined to restore the old behavior, but it may be that
    RK> someone has other thoughts. Or, maybe it is totally unimportant?

    RK> Any comments?

    RK> All my best, -richard.  -- Richard B. Kreckel


More information about the GiNaC-devel mailing list