Name: Anonymous 2010-12-14 23:04
One namespace is not enough for you in your Scheme?
You want to experiment the pleasure of being cummed inside by multiple namespaces?
From today, /prog/ can bring Lisp-n multi-faggotry directly to your Scheme environment!.
With the most advanced technologies available, we managed to produce the ultimate [b]Multi-Namespace [i]Scheme[i] Environment[/b]!
You need just to put these macros in your favourite Scheme interpreter .init file or in your source code, and then the magic will be done!
Now you can declare and call functions exactly like a Lisp-n faggot!!
Try it now for free at dis.4chan.org/prog/.
You want to experiment the pleasure of being cummed inside by multiple namespaces?
From today, /prog/ can bring Lisp-n multi-faggotry directly to your Scheme environment!.
With the most advanced technologies available, we managed to produce the ultimate [b]Multi-Namespace [i]Scheme[i] Environment[/b]!
You need just to put these macros in your favourite Scheme interpreter .init file or in your source code, and then the magic will be done!
(define sym
(lambda (f-slot v-slot)
(lambda (z a)
(case z
((fun) f-slot)
((var) v-slot)
((fun!) (set! f-slot a))
((var!) (set! v-slot a))))))
(define symtable
(lambda ()
(let ((t (make-hash)))
(define getter
(lambda (s)
(lambda (x)
(let ((g (hash-ref t x #f)))
(if g (g s #f) g)))))
(define fun
(getter 'fun))
(define var
(getter 'var))
(define function!
(lambda (x y)
(cond ((hash-ref t x #f) => (lambda (g) (g 'fun! y)))
(else (hash-set! t x (sym y #f))))))
(define variable!
(lambda (x y)
(cond ((hash-ref t x #f) => (lambda (g) (g 'var! y)))
(else (hash-set! t x (sym #f y))))))
(lambda (z a b)
(case z
((fun) (fun a))
((var) (var a))
((fun!) (function! a b))
((var!) (variable! a b)))))))
(define st (symtable))
(define I (lambda(x)x))
(define errorf (lambda xs (error (apply format xs))))
(define gfslot
(lambda (f)
(cond ((st 'fun f #f) => I)
(else (errorf "reference to a function before its definition: ~a" f)))))
(define gvslot
(lambda (v)
(cond ((st 'var v #f) => I)
(else (errorf "reference to a variable before its definition: ~a" v)))))
(define dfn
(lambda (f b)
(st 'fun! f b)))
(define dvr
(lambda (v a)
(st 'var! v a)))
(define-syntax function
(syntax-rules ()
((function f)
(gfslot 'f))))
(define-syntax variable
(syntax-rules ()
((variable v)
(gvslot 'v))))
(define-syntax defun
(syntax-rules ()
((defun f (a ...) b ...)
(dfn 'f (lambda (a ...) b ...)))
((defun f a b ...)
(dfn 'f (lambda a b ...)))))
(define-syntax defvar
(syntax-rules ()
((defvar v e)
(dvr 'v e))))
(define-syntax funcall
(syntax-rules ()
((funcall f a ...)
(apply (function f) (list a ...)))))Now you can declare and call functions exactly like a Lisp-n faggot!!
(defun fact (n)
(if (zero? n) 1
(* n (funcall fact (sub1 n)))))
(funcall fact 5)
; => 120Try it now for free at dis.4chan.org/prog/.