Skip to content
/ defstar Public

[Clojure] Experiment in macrology / Alternative definition form based on Racket's

License

Notifications You must be signed in to change notification settings

qerub/defstar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

;; def*                  (pronounced defstar)
;;
;; An experiment in macrology and in an
;; alternative definition form for Clojure
;; based on Racket's define
;;
;; Not to be confused with
;; https://bitbucket.org/eeeickythump/defstar
;;
;; - - - - - - - - - - - - - - - - - - - - - -

(use 'defstar.core)

;; It can define anything:

(def* n 42)

;; It can define functions:

(def* (f x) (+ x n))

;; It can define curried functions:

(def* ((adder x) y) (+ x y))

((adder 1) 2) ; => 3

;; It supports local definitions:

(def* (f x)
  (def n 42)
  (* n x))

(def* (f x)
  (def* (a x) (+ x 2))
  (def* (b x) (* x 2))
  (->> x a b))

;; - - - - - - - - - - - - - - - - - - - - - -
;;
;; Copyright (c) 2014 Christoffer Sawicki

About

[Clojure] Experiment in macrology / Alternative definition form based on Racket's

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages