On 13 May 2010 16:54, Ethan Grammatikidis <eeke...@fastmail.fm> wrote:
> what do you mean by "its output isn't suitable for use as input"? i'm just
> curious, have never used it that way. hum... having asked that question i
> tried some operations producing very lare numbers and they started to be
> printed with backslash-newlines in them. not nice, but such a form is
> suitable for input back to dc.

i mean that if you print output in hex, for example, the numbers
aren't tagged as such (with an 0x prefix), so you'll get corruption
or an error if you feed them back in without setting the input base
correctly.

> fc does look good for strictly command line use (scripts, perhaps?) i
> usually want to fire up a calculator in a window of its own & refer to it as
> needed.

i find it works nicely inside acme. the reverse polish input means
that if you execute it and get an output, you can just append an
operation to the end to operate on the resulting number, while
still keeping the original expression intact.

when i'm working out off the cuff sums (e.g. for household expenditure),
i'll make a text document which records the items, with little
fc fragments dotted here and there that record the actual
calculations. a poor man's spreadsheet i guess :-)

and it is good in scripts too. to take rudolf sykora's example
from earlier:
> v = `{hoc -e $min+$step'*('$i-1')'}

using fc it looks like this:

v = `{fc $min $step $i 1 - x +}

which i would argue is nicer.

Reply via email to