- View SourceWell, the more I think about it, the more I like the

idea of having a sigil (either prefix or postfix) to

tell Frink when something is a unit as opposed to a

variable. Its a bit ugly, but if you said something

like:

2 kids. / household.

to indicate that kids and households are units (and

hence should be treated as such) then you could parse

arbitrary data files that had the sigil, and you

wouldn't have to write frink code at all when you were

processing them.

I'm still thinking about what the best sigil would be

- '.' might be a bit too common and not work due to

method parsing issues, but maybe putting it in ':', eg

. :kids:, or <kids> might work.. Or even prefix it

with '$' as in perl. Or having a special keyword, say

'unit' to tell frink that it is a unit...

Ed

--- Alan Eliasen <eliasen@...> wrote:

>

__________________________________________

>

>

>

Yahoo! DSL Something to write home about.

Just $16.99/mo. or less.

dsl.yahoo.com - View SourceEdward Peschko wrote:
>> I'm not sure quite what you're saying here...

By the way, you shouldn't have to do *any* modification of many files

>>from the statement, it

>>sounds like you'd have to add the sigil to these

>>data files, which means

>>more or less writing Frink code? Or am I

>>misunderstanding your intent?

>

>

> Well, You are assuming that I'm writing Frink code to

> process

> these files. I can just as easily use perl, ruby,

> python, etc.

> to preprocess these files and add the sigil.

containing normal mathematical notation to turn it into Frink notation.

Frink is designed, more than any other language I know, to parse normal

mathematical notation and units correctly without any modification. If

you follow, say, the SI (the International System of units, the modern

"metric" system) rules and style conventions (

http://physics.nist.gov/cuu/Units/rules.html ), Frink will usually parse

your equations without ambiguity or error. Except where's there's

ambiguity in standard mathematical notation.

Most often, the biggest thing you'll need to do is put a ^ symbol in

front of exponents, 'cause cutting and pasting, or plain ASCII loses the

ability to note that a number's littler and higher up on the line.

The differences are in things that are somewhat ambiguous... Frink

requires you to write "x y" or "x*y" for something that in mathematical

notation might be "xy" because Frink allows variable names of more than

one letter. (Which is reasonable.) Other ambiguities include such

things as "sin x + y", which must be written with unambiguous brackets

"sin[x+y]". There's also an implied human-centric disambiguation in

knowing that "sin" doesn't mean "s*i*n". Normal mathematical notation

is more ambiguous than it may initially seem.

The rules of the SI are still somewhat ambiguous, but they're not too

bad. Following them will usually give you an unambiguous Frink expression.

For a really interesting look into ambiguities in standard

mathematical notation, here's a really interesting talk by Stephen

Wolfram, the main person behind Mathematica:

http://www.stephenwolfram.com/publications/talks/mathml/index.html

Especially read the section called "Computers" to read about

precedence, ambiguity in normal mathematical notation, and different

attempts to get around it. No, really, read the whole thing. It's a

really great article. Mathematica and Frink take different tactics for

underlying representation, but the problem of ambiguity in normal

mathematical notation is the same. Mathematica breaks normal SI

orthography, forcing you to write "Meter" instead of "m" or "meter",

etc, so Frink's a bit more natural.

--

Alan Eliasen | "It's amazing how much mature wisdom

eliasen@... | resembles being too tired."

http://futureboy.homeip.net/ | -- Robert Heinlein