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

Post Code

Name: Anonymous 2011-03-04 21:33

One recurring complaint is that nobody talks about code on /prog/. So everyone write go and write some code, any code, that does something, anything, and post it. A small explanation wouldn't go amiss either.

Name: Anonymous 2011-03-05 17:52

A bit of CoffeeScript I'm working on, trying to distort the language without touching the compiler.


# Arbitrary iterator over a sequence using a stepper generator
# `seq' is any list.
# `stepper' is a generator that returns either an items array or $break
# `fn' is the function to call in each item
# `apply' is just a functional version of JavaScript's Function.apply
(defun iter: (seq, stepper, fn) ->
    (letb (step = (stepper seq)) ->
        (until (eq (call step), $break)
            (apply fn, step.item))))


`until' uses FIOC, so I'm going to replace this by something else later on

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