Symbolic math in pure ruby

http://github.com/brainopia/symbolic - for people interested in symbolic
math in pure ruby, i would love contribution from community.

···

--
Posted via http://www.ruby-forum.com/.

That looks really cool, thanks!

I began something like that some time ago.

Remembering I had some awful:
module MathExp
    class Function
         def self.sq(x = nil) Function.new(:sq, x, '2x', 'x^3/3') end

I was using String for functions, as I didn't know yet the power of coerce.
But that was quite easy to get derivative and integral.

Great job !

···

2009/12/16 Ravil Bayramgalin <ravwar@gmail.com>

GitHub - brainopia/symbolic: Symbolic math for ruby - for people interested in symbolic
math in pure ruby, i would love contribution from community.
--
Posted via http://www.ruby-forum.com/\.

Looks like it would've been pretty useful for an idea I had awhile ago...

I ended up writing my own library. It's a mess, too, but if you find anything
useful, go for it:

It's even got a gemspec all ready to go, though I haven't published a gem for
it.

···

On Wednesday 16 December 2009 01:06:31 pm Ravil Bayramgalin wrote:

GitHub - brainopia/symbolic: Symbolic math for ruby - for people interested in symbolic
math in pure ruby, i would love contribution from community.

Thanks! That looks good.

Kind regards

robert

···

2009/12/16 Ravil Bayramgalin <ravwar@gmail.com>:

GitHub - brainopia/symbolic: Symbolic math for ruby - for people interested in symbolic
math in pure ruby, i would love contribution from community.

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Cool beans. Your notation is very intuitive.

I wonder if the same can be done for symbolic logic.

···

On Dec 16, 2:06 pm, Ravil Bayramgalin <rav...@gmail.com> wrote:

http://github.com/brainopia/symbolic- for people interested in symbolic
math in pure ruby, i would love contribution from community.

You should maybe try with -w:

ruby -vw symbolic.rb

ruby 1.9.2dev (2009-12-11 trunk 26067) [x86_64-darwin10.2.0]

/symbolic/summand.rb:73: warning: private attribute?
/symbolic/factor.rb:71: warning: shadowing outer local variable - base
/symbolic/factor.rb:117: warning: private attribute?

The second is easy, but the others reveal strange use of attr_reader.

Why do you use attr_reader in private context? This is only usefull in a
public context I think, as instance variables can be directly accessed by
@var (even when it is a variable from the superclass)

It correctly pass all the tests, with one warning about drb(circular
require) and these 3. Putting the attr_reader before the "private" actually
remove the warnings.

···

2009/12/16 Benoit Daloze <eregontp@gmail.com>

That looks really cool, thanks!

I began something like that some time ago.

Remembering I had some awful:
module MathExp
   class Function
        def self.sq(x = nil) Function.new(:sq, x, '2x', 'x^3/3') end

I was using String for functions, as I didn't know yet the power of coerce.
But that was quite easy to get derivative and integral.

Great job !

2009/12/16 Ravil Bayramgalin <ravwar@gmail.com>

> GitHub - brainopia/symbolic: Symbolic math for ruby - for people interested in symbolic
> math in pure ruby, i would love contribution from community.
> --
> Posted via http://www.ruby-forum.com/\.
>
>

Wonderful!

···

On Fri, Dec 18, 2009 at 12:31 AM, Intransition <transfire@gmail.com> wrote:

On Dec 16, 2:06 pm, Ravil Bayramgalin <rav...@gmail.com> wrote:
> http://github.com/brainopia/symbolic- for people interested in symbolic
> math in pure ruby, i would love contribution from community.

Cool beans. Your notation is very intuitive.

I wonder if the same can be done for symbolic logic.