Skip to content

Instantly share code, notes, and snippets.

@eshamster
Last active November 28, 2015 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eshamster/a8f853703426a711986e to your computer and use it in GitHub Desktop.
Save eshamster/a8f853703426a711986e to your computer and use it in GitHub Desktop.
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(eval-when (:compile-toplevel :execute :load-toplevel)
(ql:quickload :ps-experiment)
(ql:quickload :cl-js))
(pse:defstruct.ps parent
(a 10)
b)
(pse:defstruct.ps (child (:include parent))
(c 30))
(pse:defstruct.ps hamster a b)
(defun main (&rest argv)
(declare (ignorable argv))
(cl-js:run-js
(pse:with-use-ps-pack (:this)
(defvar x (make-child :b 20))
(print (child-a x)) ; => 10
(print (parent-a x)) ; => 10
(setf (child-a x) 50)
(print (child-a x)) ; => 50
(print (child-b x)) ; => 20
(print (child-c x)) ; => 30
(print (parent-p x)) ; => true
(print (child-p x)) ; => true
(print (hamster-p x)); => false
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment