growl/std.grr

20 lines
457 B
Text

def print { stdout fprint }
def println { stdout fprint "\n" stdout fprint }
def nl { "\n" stdout fprint }
def eprint { stderr fprint }
def eprintln { stderr fprint "\n" stderr fprint }
def when { [] if }
def unless { swap when }
def dip { swap [] curry compose call }
def keep { over [call] dip }
def bi { [keep] dip call }
def tri { [[keep] dip keep] dip call }
def times {
if: over 0 =
[drop drop]
[swap over >r >r call r> 1 - r> times];
}