# Copyright 2005-2007 Kevin Reid, under the terms of the MIT X license # found at http://www.opensource.org/licenses/mit-license.html ................ ? lisp # value: ? def timerSym := lisp["E.EXTERN", "+THE-TIMER+"] # value: x ? timerSym == lisp["e.extern:+the-timer+"] x # value: true x x ? lisp["and"] x # value: ? lisp["foo", "and"] # problem: the package "foo" does not exist ? lisp["CL", "and"] # problem: the symbol "and" does not exist in "CL" ? lisp["CL", "AND"] # value: x ? lisp["cl-user:and"] x # value: XXX interning/non-interning XXX non-external symbols symbol-value ? [def v := timerSym.get(), v == timer] # value: [, true] symbol-function ? def makeSymbolSym := lisp["CL", "MAKE-SYMBOL"] # value: ? def makeSymbol := makeSymbolSym.getFunction(); null lenient print check ? [if (E.toQuote(makeSymbol) !~ ``) {makeSymbol}] # value: [null] ? def freshSymbol := makeSymbol("HELLO-WORLD") # value: HELLO-WORLD returned values are *not* altered - XXX function-is-object-or-function issue? ? freshSymbol.__respondsTo("get", 0) # value: false for multiple-value functions - XXX write a test that shows this ? makeSymbol.tuple("FOO") # value: [FOO] ? makeSymbol.__respondsTo("run", 1) # value: true ? makeSymbol.__respondsTo("tuple", 1) # value: true ? makeSymbol.__respondsTo("run", 10) # value: false ? makeSymbol.__respondsTo("someRandomVerb", 1) # value: false __respondsTo on more complex lambda lists ? for i in 0..3 { > println(lisp["CL", "INTERN"].getFunction().__respondsTo("run", i)) > } # stdout: false # true # true # false # ? lisp["CL", "LIST"].getFunction().__respondsTo("run", 0) # value: true ? lisp["CL", "LIST"].getFunction().__respondsTo("run", 100) # value: true XXX alleged type of CL functions Conses ? def cons := lisp["CL", "CONS"].getFunction(); null ? def c := cons(1, cons(false, null)) # value: <(1, false)> ? cons(1, 2) # value: <(1 . 2)> ? cons(1, cons(2, 3)) # value: <(1, 2 . 3)> testing resolved-ref ignoring ? def np; bind np := null > cons(1, np) # value: <(1)> ? def cp; bind cp := cons(2, null) > cons(1, cp) # value: <(1, 2)> This print syntax is arbitrary and designed as a compromise between E and CL syntaxes.