Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Ruli

Name: Anonymous 2012-05-16 13:07

Ruli, or Ruby+Lisp, it's an idea I've got. Ruby's among the best for Object Oriented Programming (being the bastard son of smalltalk), and lisp is just fucking awesome (just not for OOP).

Syntax is (object method arguments), unless no object is specified and the method is one belonging to the current class, then object is assumed to be self.

Default data type is the Array because it generally uses less memory and tends to have more methods that can be done in O(1)

Object structure is similar to Ruby, with everything inheriting from the class Object and everything BEING an object itself. Many methods, however, are overridden, especially ones that tend to return an enumerator (like String.chars). Classes can also be overridden at any time like Ruby, making the language just as dynamic

example code might look like this:


(class Numeric
  (define positive? ()
    (self > 0))
  (define negative? ()
    (self < 0))
  (define sqrt ()
    (self ** 0.5)))
(class Integer
  (define prime? ()
    (define iterate (first last proc)
      (unless (first <= last)
        (proc call first)
        ((proc call first) or (iterate (first + 1) last proc))))
    (if (negative?)
      false
      (iterate 2 ((self sqrt) to Integer)
        (lambda (intgr) ((neql? intgt) and ((self % 2) neql? 0)))))))


What do you think /prog/?

Name: Anonymous 2012-05-16 14:20

So, infix operators but prefix procedure calls?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List