# HG changeset patch # User Steve Losh # Date 1468080042 0 # Node ID 277982735a9d957e9d31f60818b92146e0d1bd91 # Parent b4c25632115a4b192c3e5667e0560873b6060105 Poke at Parenscript diff -r b4c25632115a -r 277982735a9d package.lisp --- a/package.lisp Wed Jul 06 18:47:17 2016 +0000 +++ b/package.lisp Sat Jul 09 16:00:42 2016 +0000 @@ -53,3 +53,17 @@ (:shadowing-import-from #:cl-arrows #:->)) +(defpackage #:sand.parenscript + (:use + #:cl + #:defstar + #:sand.quickutils + #:cl-arrows + #:cl-fad + + #:parenscript) + (:shadowing-import-from #:cl-arrows + #:->) + (:import-from #:sand.utils) + ) + diff -r b4c25632115a -r 277982735a9d sand.asd --- a/sand.asd Wed Jul 06 18:47:17 2016 +0000 +++ b/sand.asd Sat Jul 09 16:00:42 2016 +0000 @@ -9,7 +9,9 @@ :depends-on (#:defstar #:iterate - #:cl-arrows) + #:cl-arrows + #:cl-fad + #:parenscript) :serial t :components @@ -19,4 +21,6 @@ :serial t :components ((:file "utils") (:file "random-numbers") - )))) + (:module "parenscript" + :serial t + :components ((:file "compiler"))))))) diff -r b4c25632115a -r 277982735a9d src/parenscript/compiler.lisp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/parenscript/compiler.lisp Sat Jul 09 16:00:42 2016 +0000 @@ -0,0 +1,11 @@ +(in-package #:sand.parenscript) + +(defun compile-parenscript-file (source) + (let* ((source-path (pathname source)) + (target-path (make-pathname :type "js" + :defaults source-path))) + (with-open-file (output target-path + :direction :output + :if-exists :supersede) + (write-string (ps-compile-file source-path) output))) + (values)) diff -r b4c25632115a -r 277982735a9d src/parenscript/hello.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/parenscript/hello.js Sat Jul 09 16:00:42 2016 +0000 @@ -0,0 +1,4 @@ +function sayHello(name) { + return alert('Hello, ' + name + '!'); +}; +sayHello('cocks'); diff -r b4c25632115a -r 277982735a9d src/parenscript/hello.paren --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/parenscript/hello.paren Sat Jul 09 16:00:42 2016 +0000 @@ -0,0 +1,9 @@ +(in-package #:cl-user) + +(defun say-hello (name) + (alert (+ "Hello, " name "!"))) + + +(say-hello "cocks") + + diff -r b4c25632115a -r 277982735a9d src/parenscript/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/parenscript/index.html Sat Jul 09 16:00:42 2016 +0000 @@ -0,0 +1,11 @@ + + + + + Parenscript Test + + + + Testing... + + diff -r b4c25632115a -r 277982735a9d src/random-numbers.lisp --- a/src/random-numbers.lisp Wed Jul 06 18:47:17 2016 +0000 +++ b/src/random-numbers.lisp Sat Jul 09 16:00:42 2016 +0000 @@ -53,15 +53,3 @@ form)) -(defun dammit () (make-linear-congruential-rng 50 2 3 2)) -(defparameter *r* (dammit)) -(disassemble *r*) - -(defparameter m 40) - -(defun run () - (let ((r (make-linear-congruential-rng 50 2 3 2))) - (disassemble r) - (funcall r 100000000))) - -(time (run))