Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Stleem: Matz' Streem concept implemented in Common Lisp (github.com/y2q-actionman)
22 points by networked on Dec 19, 2014 | hide | past | favorite | 8 comments


This seems conceptually similar to the threading macro "->>" in Clojure, as well as the pipe operator "|>" in elixir.

    (defn divisible? [x y]
      (zero? (rem x y)))

    (defn fizzbuzz [n]
      (cond (divisible? n 15) "Fizzbuzz"
            (divisible? n 3)  "Fizz"
            (divisible? n 5)  "Buzz"
            :else n))

    (->> (range 100)
         (map fizzbuzz)
         (apply println))


Here's a direct implementation of the Clojure -> and ->> macros in CL: https://github.com/nightfly19/cl-arrows/blob/master/arrows.l...

'fogus also points out that the Dylan compose function is similar, and that 'pg provides an implementation of that in his book ANSI Common Lisp: http://blog.fogus.me/2009/09/04/understanding-the-clojure-ma...


And the whole thing is about 340 lines of code ... Lisp power again.


There's not much power here, Streem doesn't even have a semantics yet so I don't know what this repository is implementing. They just picked something easy to write and slapped the Streem label on it and oh yeah, Lisp!!


Can anyone with any familiarity with japanese expand upon this beyond the title? google translate only takes you so far :)


For starters, if you didn't notice, Stleem is pronounced the same as Streem in Japanese, but keeps the l from lisp. Punny.

informal translation~~~

Matz created this thing... It inspired mattn to create this thing in go. And little 'ol me thought "I want to try this in lisp" so here it is.

----boring stuff----

Stleem is a thing where you stick one thing in and get one thing out.

In order to create the result, stleem uses something like a filter (see how fizzbuzz filters to print the result)

If (there's no arg/the arg is ignored??) it has generator-like behavior.

When the pipeline is closed, if there's no result, nil is returned.

Otherwise the start up parameter :end-symbol is modified.

Keep in mind that this is only a sample. How to handle multiple args and discarding things, etc, etc, there's a lot of problems.

~~~end

I don't know lisp and I used rikaichan a lot but I'm pretty sure I got it mostly right.


Just to make it clear, the author discloses that beyond the sample it doesn't work, and there's lots of problems he doesn't tackle.

Also, from the tone of it, one should have no expectation of this going further. It seems mostly aimed to be a test of how it would look like in lisp and nothing more.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: