Re: Literate programming with calc (help)

2023-09-10 Thread Ypo
; From:     Ihor Radchenko > Subject:     Re: LIterate programming with calc (help) > Date:     Tue, 01 Nov 2022 07:22:18 + "Fraga, Eric" writes: >/> I guess that the main problem is that calc is ti

Re: LIterate programming with calc (help)

2022-11-26 Thread Ypo
Just in case you find this package interesting. Except some problems with units conversion, it's nice: https://github.com/sulami/literate-calc-mode.el This is a literate calc file. Lines without "=" are ignored. All results starting with "=>" are an overlay generated by literate-calc-mode.

Re: LIterate programming with calc (help)

2022-11-01 Thread Ihor Radchenko
"Fraga, Eric" writes: >> I guess that the main problem is that calc is tightly integrated with >> interactive commands. Maybe ob-calc could be extended to somehow >> indicate the commands to be executed in addition to inputting stack >> entries. >> >> Not sure if there is much interest in such

Re: LIterate programming with calc (help)

2022-10-31 Thread Fraga, Eric
On Monday, 31 Oct 2022 at 09:23, Ihor Radchenko wrote: > I looked into ob-calc and it looks like the way to define variables is > via :var header argument. Indeed. Something like :var a="300 m" does work. > I guess that the main problem is that calc is tightly integrated with > interactive

Re: LIterate programming with calc (help)

2022-10-31 Thread Ihor Radchenko
Ypo writes: > Would it be something like this? > > #+begin_src calc >   a = 300 m >   b = 300 m >   Area = a*b >   cost = 1 ($/m^2) >   A*c > > #+end_src I looked into ob-calc and it looks like the way to define variables is via :var header argument. Other than that, ob-calc simply does

Re: LIterate programming with calc (help)

2022-10-24 Thread Fraga, Eric
On Monday, 24 Oct 2022 at 13:26, Ypo wrote: > Why do you think it doesn't work something more human readable like this? > > #+begin_src calc >solve([ >a = 300 m, >b = 300 m, >Area = a*b, >cost = 1 (USD/m^2), >

Re: LIterate programming with calc (help)

2022-10-24 Thread Ypo
Not bad, thanks!!! Why do you think it doesn't work something more human readable like this? #+begin_src calc    solve([    a = 300 m,    b = 300 m,    Area = a*b,    cost = 1 (USD/m^2),    z = Area*cost    ],

Re: LIterate programming with calc (help)

2022-10-24 Thread Christian Moe
Fraga, Eric writes: > On Monday, 24 Oct 2022 at 09:20, Ihor Radchenko wrote: >> I vaguely recall that storing variables in calc is something like >> variable := assignment (which is actually rewrite rule, but that's how >> 13.1 Storing Variables section of the calc manual explains variable >>

Re: LIterate programming with calc (help)

2022-10-24 Thread Ihor Radchenko
"Fraga, Eric" writes: > On Sunday, 23 Oct 2022 at 14:15, Ypo wrote: >> Is it possible to express in a calc block some basic operations with >> variables and non-predefined units? > >> Why A*c won't show an arithmetic result, but ~: A c ~? > > I've never managed to get calc blocks define

Re: LIterate programming with calc (help)

2022-10-24 Thread Fraga, Eric
On Monday, 24 Oct 2022 at 09:20, Ihor Radchenko wrote: > I vaguely recall that storing variables in calc is something like > variable := assignment (which is actually rewrite rule, but that's how > 13.1 Storing Variables section of the calc manual explains variable > assignments). That is true

Re: LIterate programming with calc (help)

2022-10-24 Thread Fraga, Eric
On Sunday, 23 Oct 2022 at 14:15, Ypo wrote: > Is it possible to express in a calc block some basic operations with > variables and non-predefined units? > Why A*c won't show an arithmetic result, but ~: A c ~? I've never managed to get calc blocks define variables. The equations you have typed