From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <34C68D51-B2FF-4D3A-B4A0-C4B539CAD060@fastmail.fm> References: <158d5dc0571fa04cab44a99b3fdf5921@kw.quanstro.net> <84f53dabe8357c852216d6c9024f6eb0@coraid.com> <34C68D51-B2FF-4D3A-B4A0-C4B539CAD060@fastmail.fm> Date: Thu, 13 May 2010 17:08:20 +0100 Message-ID: From: roger peppe To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] hoc output format Topicbox-Message-UUID: 20804626-ead6-11e9-9d60-3106f5b1d025 On 13 May 2010 16:54, Ethan Grammatikidis 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.