unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Exchanging variables between Calc and Embedded Calc
@ 2012-08-27 19:35 Gilles Charron
  2012-08-27 21:04 ` Jay Belanger
  0 siblings, 1 reply; 2+ messages in thread
From: Gilles Charron @ 2012-08-27 19:35 UTC (permalink / raw)
  To: emacs-devel

Hi,

  I've been using embedded calc for some time now and have been looking for an
answer to the following:

Is it possible, from "calc" to read embedded calc variables?

Suppose I have the following in a file:

myVariable := 1.5 + 13 => 14.5

Hitting C-x * u will refresh "14.5" and now embedded calc knowns about 
"myVariable".

If I switch to "calc mode" (C-x * c), how can I get access to "myVariable"?

From the embedded calc manual:

"The assignment operator `a := 17' does not actually do anything by itself. But
Embedded Mode recognizes it and marks it as a sort of file-local definition of
the variable."

How can I access these "file-local definitions"?  Also, is it possible to set
"embedded" calc variables from calc?

Thanks!

Regards,
Gilles




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Exchanging variables between Calc and Embedded Calc
  2012-08-27 19:35 Exchanging variables between Calc and Embedded Calc Gilles Charron
@ 2012-08-27 21:04 ` Jay Belanger
  0 siblings, 0 replies; 2+ messages in thread
From: Jay Belanger @ 2012-08-27 21:04 UTC (permalink / raw)
  To: Gilles Charron; +Cc: jay.p.belanger, emacs-devel


> Is it possible, from "calc" to read embedded calc variables?
...
> myVariable := 1.5 + 13 => 14.5
...
> If I switch to "calc mode" (C-x * c), how can I get access to "myVariable"?
>
> From the embedded calc manual:
>
> "The assignment operator `a := 17' does not actually do anything by itself. But
> Embedded Mode recognizes it and marks it as a sort of file-local definition of
> the variable."

If you have something like
x := 4
in embedded Calc, then you can use calc-store (s s RET) to assign the
value 4 to x in Calc.  You can then use calc-evalto (s =) to get
x := 4 =>
In your case, though, while this would assign 14.5 to myVariable in
Calc, it would also leave you with
myVariable := 14.5 => 14.5
in embedded Calc.

> How can I access these "file-local definitions"?  Also, is it possible to set
> "embedded" calc variables from calc?

If a variable has a value in Calc and it isn't overridden in embedded
Calc, then the variable will have the same value in embedded Calc.

Jay



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-27 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27 19:35 Exchanging variables between Calc and Embedded Calc Gilles Charron
2012-08-27 21:04 ` Jay Belanger

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).