[extropy-chat] funky frink function

Matthew Gingell gingell at gnat.com
Wed Oct 27 20:49:58 UTC 2004


Alan Eliasen writes:

 > You can think of the -> operator as a very-low-precendence divide
 > operator, if that helps.

 How can I do stuff like convert Fahrenheit to Kelvin then? 

 eg: 

   1 degreeFahrenheit -> "kelvin" =>
    5/9 (approx. 0.5555555555555556) kelvin

 Is there something in Frink like the operator "in" in the Google
 calculator language, eg:

   1 degree Fahrenheit in Kelvin =>
    1 degree Fahrenheit = 255.927778 Kelvin

 (In fairness I think the fault here lies with Herr Fahrenheit, rather
  than with Mr. Eliasen.)

 Also, it's nice that Google accepts "degree Fahrenheit" rather than
 expecting "degreeFahrenheit." It guess though that the dynamic nature
 of Frink would make implementing that pretty silly - the lexer would
 have to know at run time the full symbol table, and defining new
 identifiers could potentially ambiguate existing ones...



More information about the extropy-chat mailing list