Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 14 lines (9 sloc) 0.348 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14
;; Handy syntactic sugar, using read-macros.

(require 'read)

;; This creates an Arc-like singe-argument lambda function.
;; [+ _ 5] -> (lambda (_) (+ _ 5))

(define-macro-character (#\] port)
  (throw-error "read unexpected ']'" #\]))

(define-macro-character (#\[ port)
  `(lambda (_) ,(read:list port #\])))

;(display (map [+ _ 10] (upto 5)))
Something went wrong with that request. Please try again.