highlight-lisp/index.md
2013-03-20 14:28:37 -07:00

1.4 KiB

title layout
Highlighter demo default

highlight-lisp demo

;; known globals
*read-base*
(let* ((*package* nil)) 'random-symbol)   ; let/let*/lambda are "special"

;; known functions, unknown globals
(when (<= 17.69 (get-value))
  (incf *my-global-lol*))

;; number tests
;; all have class "number", but depending on type have integer, float, hex, binary
'(80 -69.4 +5 822342.287 #xf40d #b0101)

;; t/nil + strings
(format t "highlight-lisp.js sucksp: ~a~%" nil)

;; testing lambda-list specials (&key, &body, etc), multi-line strings,
;; constants, symbols, keywords
;;
(defun test-me (lol &key omg (lol 'wtf))
  (let ((*global* 'ur-mom)
          (strings "r pretty kewl LOL")
                  (multi-line-strings "can be badass
                              as well")
                          (+my-constant+ "wait, constants don't change!!"))
      (make-instance 'error :message "YOU SUCK!!!")))

;; known vs unknown #'functions
(make-hash-table :test #'equal)
(make-hash-table :test #'equalzz)

;; testing known keywords (have class "known" as well as "keyword")
(loop for x being the :hash-keys of my-hash-table collect x)