(index ("make-spock-state" 0) ("spock-state?" 187) ("current-spock-state" 342) ("spock" 638) ("spock-initialize" 1072) ("<spock>" 1455) ("<spock-header>" 2411) ("begin1" 3650) ("fluid-let" 3774) ("when" 3946) ("unless" 3946) ("cut" 4085) ("cond-expand" 4236) ("define-syntax-rule" 4400) ("new" 4595) ("define-native" 4856) ("define-native-method" 4990) ("define-entry-point" 5202) ("define-entry-point" 5202) ("%" 5490) ("bind-method" 5657) ("callback" 5879) ("callback-method" 6046) ("compl" 6306) ("const" 6416) ("current-error-port" 6510) ("exit" 6689) ("file-exists?" 6815) ("id" 6983) ("jstring" 7052) ("milliseconds" 7224) ("native" 7339) ("native-method" 7500) ("o" 7699) ("print" 7773) ("void" 7911) ("void?" 8019) ("with-input-from-port" 8134) ("with-output-to-port" 8134) ("%code" 8416) ("%host-ref" 8508) ("%host-set!" 8508) ("%inline" 8822) ("%inline" 8822) ("%native-lambda" 9114) ("%new" 9423) ("%property-ref" 9615) ("%property-set!" 9615))
(def (sig (procedure "(make-spock-state OPTION ...)" (id make-spock-state))) (p "Creates a fresh compilation state, with settings given in " (tt "OPTION ..") " and returns this state."))
(def (sig (procedure "(spock-state? X)" (id spock-state?))) (p "Returns " (tt "#t") " if " (tt "X") " is a compilaton state or " (tt "#f") " otherwise."))
(def (sig (parameter "current-spock-state" (id current-spock-state))) (p "The currently active compilation state. Defaults to " (tt "#f") ", which means a new state will be created automatically for the next compilation (via " (tt "<spock>") ") and will be re-used on subsequent compilations."))
(def (sig (procedure "(spock FILENAME-OR-OPTION ...)" (id spock))) (p "The main interface to the compiler. Any string-argument given will be taken as the name of a Scheme source file to be compiled. If the " (tt "code") " option is given and followed by an expression, then that expression is compiled instead of reading source from files. The other options are the same as those that can be passed to " (tt "make-spock-state") "."))
(def (sig (procedure "(spock-initialize OPTIONS ...)" (id spock-initialize))) (p "Creates a compilation state using the given options and sets the value of the parameter " (tt "current-spock-state") ".  Initialization of a compilation state needs a bit of internal setup, so it is advisable to call this procedure in time-critical applications that need to generate code quickly."))
(def (sig (syntax "(<spock> FORM)" (id <spock>))) (p "Compiles the Scheme (unquoted) expression " (tt "FORM") " using the current compilation state and returns the generated JavaScript code as a string. " (tt "FORM") " may contain sub-expressions of the form " (tt "(<unscript>") " and " (tt "<unscript-splicing>") ", respectively, which work similar to " (tt "unquote") " and " (tt "unquote-splicing") " in R5RS Scheme, but switch between code to be compiled and code or literal data to be computed in the host environment, e.g.") (pre " (<spock>\n   (begin\n     (define (square x) (* x x))\n     (print (square '(<unscript> (read))))))") (p "will return a " (tt "<script>") " HTML element containing JavaScript code that defines a function and calls it with the argument read at execution of the " (tt "<spock>") " expression.") (p "Note that the compiled form needs runtime support code to execute successfully. See " (tt "<spock-header>") " below."))
(def (sig (procedure "(<spock-header> #!key minified debug path)" (id <spock-header>))) (p "Emits HTML to load the runtime system. Keyword-arguments are available to specify whether a \"minified\" version of the runtime library should be loaded, and whether a debug version should be used. Minified means a compressed library that can be loaded faster by the client. The debug version performs additional error checks and keeps a trace of recently invoked functions.") (p "Note that the JavaScript files containing the runtime library need to be available to be transmitted to the client. In the usual case of web-server code generating script content this means, one of the files") (pre " spock-runtime.js\n spock-runtime-min.js\n spock-runtime-debug.js\n spock-runtime-debug-min.js") (p "should be in a location that holds files to be retrieved by the client and it should match the keyword arguments given to " (tt "<spock-header>") ". The " (tt "path") " keyword argument can be used to override the path prefix and defaults to an empty path.") (p "The runtime library is installed in " (tt "spock") " subdirectory of the extension repository and can be located in the path returned by entering") (pre " chicken-spock -library-path"))
(def (sig (syntax "(begin1 X1 X2 ...)" (id begin1))) (p "Evaluates the forms and returns the result(s) of the first one."))
(def (sig (syntax "(fluid-let ((ID1 X1) ...) BODY ...)" (id fluid-let))) (p "Dynamically binds the variables " (tt "ID1 ...") " during the execution of " (tt "BODY") "."))
(def (sig (syntax "(when X1 BODY ...)" (id when)) (syntax "(unless X1 BODY ...)" (id unless))) (p "Conditionals with the usual meaning."))
(def (sig (syntax "(cut ...)" (id cut))) (p (link "http://srfi.schemers.org/srfi-26/srfi-26.html" "Syntactic sugar for specializing parameters") "."))
(def (sig (syntax "(cond-expand CLAUSE ...)" (id cond-expand))) (p (link "http://srfi.schemers.org/srfi-0/srfi-0.html" "Feature-based conditional expansion") "."))
(def (sig (syntax "(define-syntax-rule (NAME ARG ...) BODY)" (id define-syntax-rule))) (p "Equivalent to") (highlight scheme "(define-syntax NAME\n  (syntax-rules ()\n    ((_ ARG ...) BODY)))"))
(def (sig (syntax "(new CLASS KEY1 VALUE1 ...)" (id new))) (p "Creates a JavaScript object that has the constructor " (tt "CLASS") ", which must be a native JavaScript function. The arguments should be a list of alternating keys (native strings) and values."))
(def (sig (syntax "(define-native NAME ...)" (id define-native))) (p "Declares " (tt "NAME") " to be a native JavaScript function."))
(def (sig (syntax "(define-native-method NAME ...)" (id define-native-method))) (p "Declares " (tt "NAME") " to be a native JavaScript method, which takes an additional initial argument (the \"this\" object)."))
(def (sig (syntax "(define-entry-point NAME EXP)" (id define-entry-point)) (syntax "(define-entry-point (NAME . LLIST) BODY ...)" (id define-entry-point))) (p "Declares " (tt "NAME") " to be a global JavaScript variable which will execute " (tt "BODY") " when called from native code."))
(def (sig (procedure "(% STRING1 VALUE1 ...)" (id %))) (p "Creates an anonymous JavaScript object from the keys and values given by " (tt "STRING1 VALUES1 ...") "."))
(def (sig (procedure "(bind-method JSFUNC OBJECT)" (id bind-method))) (p "Returns a procedure that will invoke the native JavaScript function " (tt "JSFUNC") " with " (tt "OBJECT") " as the implicit \"this\" parameter."))
(def (sig (procedure "(callback PROC)" (id callback))) (p "Returns a native JavaScript function that, when invoked, will call the Scheme procedure " (tt "PROC") "."))
(def (sig (procedure "(callback-method PROC)" (id callback-method))) (p "Returns a native JavaScript function that, when invoked as a method, will pass the implicit \"this\" parameter as an additional first argument to the Scheme procedure " (tt "PROC") "."))
(def (sig (procedure "(compl PROC)" (id compl))) (p "Equivalent to " (tt "(lambda (x) (not (PROC x)))") "."))
(def (sig (procedure "(const X)" (id const))) (p "Equivalent to " (tt "(lambda _ (X))") "."))
(def (sig (procedure "(current-error-port)" (id current-error-port))) (p "Returns the port that will receive error output. The exact behaviour depends on the host environment."))
(def (sig (procedure "(exit [CODE])" (id exit))) (p "Exits the JavaScript interpreter (not functional inside the browser)."))
(def (sig (procedure "(file-exists? STRING)" (id file-exists?))) (p "Returns " (tt "#t") " if a file with the given name exists (not functional inside the browser)."))
(def (sig (procedure "(id X)" (id id))) (p "Returns " (tt "X") "."))
(def (sig (procedure "(jstring X)" (id jstring))) (p "If " (tt "X") " is a mutable string, returns a native JavaScript string. Any other argument is returned unchanged."))
(def (sig (procedure "(milliseconds [THUNK])" (id milliseconds))) (p "Returns the current time in milliseconds."))
(def (sig (procedure "(native JSFUNC)" (id native))) (p "Returns a procedure that, when called, will invoke the native JavaScript function " (tt "JSFUNC") "."))
(def (sig (procedure "(native-method JSFUNC)" (id native-method))) (p "Returns a procedure that, when called, will pass the first argument as the implicit \"this\" parameter to " (tt "JSFUNC") "."))
(def (sig (procedure "(o PROC ...)" (id o))) (p "Function-composition."))
(def (sig (procedure "(print X ...)" (id print))) (p "Prints its argument to the current output port. Depends on the host environment."))
(def (sig (procedure "(void ...)" (id void))) (p "Ignores its arguments and returns the undefined value."))
(def (sig (procedure "(void? X)" (id void?))) (p "Returns " (tt "#t") " if " (tt "X") " is the undefined value."))
(def (sig (procedure "(with-input-from-port PORT THUNK)" (id with-input-from-port)) (procedure "(with-output-to-port PORT THUNK)" (id with-output-to-port))) (p "Invoke the zero-argument procedure " (tt "THUNK") " with the current input or output port changed to " (tt "PORT") "."))
(def (sig (syntax "(%code STRING ...)" (id %code))) (p "Embeds JavaScript code directly."))
(def (sig (syntax "(%host-ref NAME ...)" (id %host-ref)) (syntax "(%host-set! NAME X)" (id %host-set!))) (p "Retrieves a JavaScript variable or assigns a new value to it. Note that no automatic value conversion takes place, in particular, strings should be converted to the native representation when assigned."))
(def (sig (syntax "(%inline .NAME THIS X ...)" (id %inline)) (syntax "(%inline NAME X ...)" (id %inline))) (p "Embeds code for an inline JavaScript operation. The first form invokes the method " (tt "NAME") " on the object " (tt "THIS") ". The second invokes a normal JavaScript function."))
(def (sig (syntax "(%native-lambda STRING ...)" (id %native-lambda))) (p "Returns a procedure containing native JavaScript code. Use " (tt "arguments") " to refer to the function arguments. The implicit variable " (tt "K") " holds the continuation and should be invoked with the result value(s) on return."))
(def (sig (syntax "(%new CLASS X ...)" (id %new))) (p "Invokes the object constructor " (tt "CLASS") " (which should be a string or symbol) with the given arguments and returns the object."))
(def (sig (syntax "(%property-ref NAME [X])" (id %property-ref)) (syntax "(%property-set! NAME X Y)" (id %property-set!))) (p "Retrieve or set the named property " (tt "NAME") " (a string or symbol) of object " (tt "X") ". The second form assigns " (tt "Y") " to the property " (tt "NAME") " of " (tt "X") ". No automatic argument conversions take place.") (p (tt "(%property-ref NAME)") " is a shortcut for " (tt "(lambda (x) (%property-ref NAME))") "."))
