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 13:11

Also, "to" is a method for all objects that is overridden. It's to replace all that shitty "to_a" "to_s" junk that makes for some very ugly code. I'm also replacing "is_a?" with "is?" While it might not make everything sound like proper English, it's easier on the eyes.

Name: Anonymous 2012-05-16 13:11

I'll stick with CL.

Name: Anonymous 2012-05-16 13:45

do not want

Name: Anonymous 2012-05-16 14:20

So, infix operators but prefix procedure calls?

Name: Anonymous 2012-05-16 15:27

>>5

Just as object oriented programming was intended.

Name: Anonymous 2012-05-16 15:57

(iterate (first + 1) last proc)
((self sqrt) to Integer)
Shouldn't it be (self iterate ...) to keep things uniform?

(proc [b]call[/b] first)
no.

Name: bampu pantsu 2012-05-29 5:00

bampu pantsu

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