From: Francis Hwang Date: 2005-02-04T09:30:44+09:00 Subject: Re: [ANN] LXL (Like Excel) 0.1.0 - A mini-language that mimics Microsoft Excel formulas. Kevin, Pretty interesting. So why did you write this? Did you have particular applications in mind? Would LXL be suitable for, say, exporting the logic in an advanced Excel spreadsheet into something in Ruby? On Feb 3, 2005, at 12:50 PM, Kevin Howe wrote: > Hi all, > > I've just released LXL (Like Excel) 0.1.0, a mini-language that mimics > Microsoft Excel formulas. It can be easily extended with new constants > and > functions. > > http://www.rubyforge.org/projects/lxl/ > > Install > ------- > > gem install lxl > > Usage > ----- > > formulas = %{ > ((1+2)*(10-6))/2; > DATETIME("2004-11-22 11:11:00")=DATE(2004,11,22)+TIME(11,11,00); > IN(" is ", "this is a string"); > LIST(1, "two", 3.0); > IN("b", LIST("a", "b", "c")); > AND(TRUE, NULL); > OR(TRUE, FALSE); > IF(1+1=2, "yes", "no"); > } > > # single formula > puts LXL.eval('5+5').inspect > # => 10 > > # multiple formulas separated by semi-colon > puts LXL.eval(formulas).inspect > # => [6, true, true, [1, "two", 3.0], true, false, true, "yes"] > > See API docs for more information. > > Regards, > Kevin > > > > Francis Hwang http://fhwang.net/