summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-12-13update NEWSAndy Wingo1-0/+91
* NEWS: Update.
2010-12-13fix bugs in primitive-pollAndy Wingo1-3/+13
* libguile/poll.c (scm_primitive_poll): Only mark POLLOUT for output ports. Don't override results from the syscall, add to them.
2010-12-12fix testing code in web/serverAndy Wingo2-5/+3
* module/web/server.scm (call-with-encoded-output-string): Fix some code I accidentally left in while testing. Re-tested the difference in speed; pleasantly surprised. * module/web/uri.scm: Make the same change here.
2010-12-12foreign: c-struct parsing simplificationAndy Wingo1-101/+17
* module/system/foreign.scm: Revert much of fb636a1cce. Short et al are not distinct types -- they are all aliases to e.g. int16. The only case that was not covered before was the pointer case. (bytevector-pointer-ref, bytevector-pointer-set!): Implement these, and use them for pointers.
2010-12-121.9.13 news to main bodyAndy Wingo1-137/+74
* NEWS: Fold 1.9.13 text into the main text.
2010-12-12http-read robustnessAndy Wingo1-2/+4
* module/web/server/http.scm (http-read): Record the client index in more cases in which code could throw an error.
2010-12-11(web uri) can uri-decode non-utf-8 payloadsAndy Wingo1-11/+38
* module/web/uri.scm (call-with-encoded-output-string, encode-string): Copy from server.scm (decode-string): Copy from tekuti. (uri-decode): The #:charset arg is a string, like port-encoding. Support other charsets. (uri-encode): Charset is a string. Other encodings still not nicely supported. Hmm.
2010-12-10add return/values hack to compile-glil for luaAndy Wingo1-0/+7
* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add a hack like 'return but for multiple values, for lua.
2010-12-10rnrs control only depends on (guile)Andy Wingo1-2/+1
* module/rnrs/control.scm: Depend only on (guile).
2010-12-10fix self-tail-calls for lexical procs with optional, rest, or kwargsAndy Wingo2-16/+30
* module/language/tree-il/compile-glil.scm (flatten-lambda): Don't emit a self-label, because when we can't match the args for a lexical call, we have no space to shuffle args and jump. (flatten): Apply the self-tail-call optimization to optional args too, but only if the procedure is fix-allocated. If we can't apply the optimization, use the normal tail-call sequence. * test-suite/tests/optargs.test ("lambda* inits"): Add tests.
2010-12-09clarify compile-glil error messagesAndy Wingo1-17/+18
* module/language/tree-il/compile-glil.scm (vars->bind-list, flatten): Make internal self-checking error messages more clear, for implementors of other languages.
2010-12-07Get rid of `define-macro' in the SRFI 26 implementationAndreas Rottmann1-26/+43
* module/srfi/srfi-26.scm (cut, cute): Implement using `syntax-case'. The new implementation is mostly just a transcription of the old code; the reference implementation which relies only on `syntax-rules' may (or may not) be considered more elegant :-). Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2010-12-07Use `current-processor-count' to determine the number of future-workers.Ludovic Courtès2-5/+9
* module/ice-9/futures.scm (%worker-count): Use `current-processor-count'. * doc/ref/api-scheduling.texi (Futures): Add note about side-effects and I/O. Mention `current-processor-count'.
2010-12-07Add `total-processor-count' and `current-processor-count'.Ludovic Courtès4-0/+71
* libguile/posix.c (scm_total_processor_count, scm_current_processor_count): New functions. * libguile/posix.h (scm_total_processor_count, scm_current_processor_count): New declarations. * test-suite/tests/posix.test ("nproc"): New test prefix. * doc/ref/posix.texi (Processes): Document `total-processor-count' and `current-processor-count'.
2010-12-07Improve doc of `getaffinity' and `setaffinity'.Ludovic Courtès2-4/+12
* doc/ref/posix.texi (Processes): Add cross-reference from `setaffinity' and `getaffinity' to the corresponding node in the glibc manual. * libguile/posix.c (scm_getaffinity, scm_setaffinity): Likewise.
2010-12-07Temporarily fix `unistr.in.h' to allow compilation with `-Wundef'.Ludovic Courtès1-14/+14
See <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/24225> for details. * lib/unistr.in.h: Change #if's into #ifdef's.
2010-12-07Use Gnulib's `nproc'.Ludovic Courtès90-673/+2517
This updates Gnulib to v0.0-4496-g6491120. * m4/gnulib-cache.m4: Add `nproc'.
2010-12-07Build dlopenable modules with `-module'.Ludovic Courtès1-3/+3
* test-suite/standalone/Makefile.am (libtest_asmobs_la_LDFLAGS, libtest_ffi_la_LDFLAGS, libtest_extensions_la_LDFLAGS): Add `-module'.
2010-12-07Add a record type printer for vlists/vhashes.Ludovic Courtès1-0/+16
* module/ice-9/vlist.scm (<vlist>): Add a record type printer.
2010-12-07lexical function binding for elispBrian Templeton4-19/+45
* module/language/elisp/compile-tree-il.scm (access-variable) (reference-variable, set-variable!): Handle globally-bound non-special variables. (bind-lexically?): Create lexical bindings for flet and flet*. * module/language/elisp/runtime.scm (reference-variable, set-variable!): Handle globally-bound non-special variables. (built-in-func): Set the variable directly instead of storing the function in a fluid. * module/language/elisp/runtime/subrs.scm (funcall): Call apply directly. * test-suite/tests/elisp-compiler.test ("Function Definitions")["flet and flet*"]: Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07use unbound fluids instead of `void' sentinel valueBrian Templeton6-126/+83
* module/language/elisp/compile-tree-il.scm (reference-with-check) (compile-without-void-checks, want-void-check?): Remove. (compile-function, compile-pair): Use `reference-variable' instead of `reference-with-check'. (compile-defvar): Only set `sym' if `sym' is not bound to a bound fluid, rather than requiring that its value be `void'. (process-options!): Remove `#:disable-void-check' option handling. * module/language/elisp/runtime.scm (void) (reference-variable-with-check): Remove. (ensure-fluid!): Use an undefined fluid as the initial value for global variables. * module/language/elisp/runtime/function-slot.scm (without-void-checks): Don't import or re-export. * module/language/elisp/runtime/macros.scm (prog1, cond, or, dolist): Don't use `without-void-checks'. * module/language/elisp/runtime/subrs.scm (symbol-value) (symbol-function, apply): Use `reference-variable' instead of `reference-variable-with-check'. (makunbound, fmakunbound, boundp, fboundp): Unset the variable's fluid (or the variable itself, if it isn't bound to a fluid). * test-suite/tests/elisp-compiler.test ("Variable Setting/Referencing")["disabled void check (all)", "disabled void check (symbol list)", "without-void-checks"]: Remove. Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07function's argument can be a symbolBrian Templeton1-1/+3
* module/language/elisp/compile-tree-il.scm (compile-function): the form `(function SYMBOL)' evaluates to the functional value of SYMBOL Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07allow `(setcar nil nil)' and `(setcdr nil nil)'Brian Templeton1-2/+6
* module/language/elisp/runtime/subrs.scm (setcar, setcdr): Allow setting the car or cdr of `nil' to `nil'. Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07support "#'" syntax for function expressionsBrian Templeton2-3/+10
* module/language/elisp/lexer.scm (lex): * module/language/elisp/parser.scm (get-expression): Support sharpsign single-quote syntax as an abbreviation for `function' expressions. Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07setq can take any number of argumentsBrian Templeton1-29/+16
* module/language/elisp/compile-tree-il.scm (compile-setq): Return nil if called with no arguments, and set the last variable to nil if its value is omitted. Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07use correct names for quasiquotation operatorsBrian Templeton5-19/+19
Use #{`}#, #{,}# and #{,@}# as the quasiquote, unquote and unquote-splicing operators, respectively. Previously they were named escaping. * module/language/elisp/compile-tree-il.scm (unquote?): Change "\," to "#{,}#". (unquote-splicing): Change "\,@" to "#{,@}#". (#{compile-`}#): Rename from #{compile-\`}#. * module/language/elisp/runtime/function-slot.scm: Import #{compile-`}# instead of #{compile-\`}#, and re-export as #{`}# instead of as #{\`}#. * module/language/elisp/parser.scm (quotation-symbols): * test-suite/tests/elisp-compiler.test ("Eval", "Quotation"): * test-suite/tests/elisp-reader.test ("Parser"): Change "\`", "\,", and "\,@" to "#{`}#", "#{,}#" and "#{,@}#", respectively.
2010-12-07store special operators in the function slotBrian Templeton4-233/+332
If the function slot of a symbol contains a pair with `special-operator' in the car and a procedure in the cdr, the procedure is called to compile the form to Tree-IL. This is similar to other Emacs Lisp implementations, in which special operators are subrs. * module/language/elisp/compile-tree-il.scm: Restructured to store special operator definitions in the function slot. Import `(language elisp runtime)' for `defspecial'. Export special operators so that `(language elisp runtime function-slot)' can re-export them. (backquote?): Removed; the backquote symbol is defined as a special operator, so it's no longer used in `compile-pair'. (is-macro?, get-macro): Replaced by `find-operator'. (find-operator): New procedure. (compile-progn, compile-if, compile-defconst, compile-defvar, compile-setq, compile-let, compile-lexical-let, compile-flet, compile-let*, compile-lexical-let*, compile-flet*, compile-without-void-checks, compile-with-always-lexical, compile-guile-ref, compile-guile-primitive, compile-while, compile-function, compile-defmacro, compile-defun, #{compile-`}#, compile-quote): New special operators with definitions taken from the pmatch form in `compile-pair'. There is no special operator `lambda'; it is now a macro, as in other Elisp implementations. (compile-pair): Instead of directly compiling special forms, check for a special operator object in the function slot. * module/language/elisp/runtime.scm: Export `defspecial'. (make-id): New function. (built-in-macro): Prefix macros with `macro-'. (defspecial): New syntax. * module/language/elisp/runtime/function-slot.scm: Import and re-export special operators. Rename imported special operators and macros to remove prefixes. Re-export new macro `lambda'. * module/language/elisp/runtime/macros.scm (macro-lambda): New Elisp macro.
2010-12-07update elisp reader tests to handle EOF tokensBrian Templeton1-6/+6
* test-suite/tests/elisp-reader.test (lex-all, "end-of-input", "lexer/1"): Check for an EOF token instead of the symbol `*eoi*'.
2010-12-07make user-defined macros available at runtimeBrian Templeton1-20/+28
* module/language/elisp/compile-tree-il.scm (ensuring-globals): New procedure. (define-macro!): Remove. (compile-pair) <defmacro>: Make macro available at runtime, not only during compilation. (compile-tree-il): Use `ensuring-globals'.
2010-12-07allow fluid macro bindingsBrian Templeton1-2/+4
* module/language/elisp/compile-tree-il.scm (define-macro!, get-macro): Allow fluid macro bindings.
2010-12-07new `load' subrBrian Templeton2-1/+7
* module/language/elisp/runtime/subrs.scm: Define new subr `load'. * module/language/elisp/runtime/function-slot.scm: Re-export `load'.
2010-12-07Ignore #:warnings compiler optionBrian Templeton1-0/+2
* module/language/elisp/compile-tree-il.scm (process-options!): Ignore #:warnings compiler option.
2010-12-07handle EOF correctly in parser and lexerBrian Templeton2-5/+10
* module/language/elisp/lexer.scm (lex, get-lexer/1): Return a valid token at EOF. * module/language/elisp/parser.scm (get-expression): Raise an error if EOF is reached. (read-elisp): If at EOF, return the EOF object instead of attempting to read an expression. Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07store macro definitions in the function slotBrian Templeton6-352/+452
Guile Emacs Lisp previously kept macros in a separate macro slot; now macros are stored as macro objects in the function slot for compatibility with other implementations. * module/language/elisp/compile-tree-il.scm (macro-slot): Remove. (is-macro?): Check that the argument is a symbol. Now-unnecessary check removed in `compile-tree-il'. (macro?, define-macro!, get-macro): Store macro definitions in the function slot, not in a separate macro slot. * module/language/elisp/runtime.scm (built-in-macro): Wrap the macro function in a macro object (i.e., cons the symbol `macro' onto it). * module/language/elisp/runtime/function-slot.scm: Move contents to "subrs.scm". Re-export function and macro definitions instead of defining functions directly in this module. * module/language/elisp/runtime/macro-slot.scm: Move contents to "macros.scm" and remove. * module/language/elisp/runtime/macros.scm: New file containing macro definitions from "macro-slot.scm". * module/language/elisp/runtime/subrs.scm: New file containing function definitions from "function-slot.scm". Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07use existing bindings record for defmacroBrian Templeton1-2/+1
* module/language/elisp/compile-tree-il.scm (compile-pair): Use existing bindings record during macro definition.
2010-12-07use tree-il's support for optional argumentsBrian Templeton1-189/+101
* module/language/elisp/compile-tree-il.scm (compile-lambda): Use Tree-IL's support for optional arguments. (process-optionals, process-rest): Remove. Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07make `pass-if-equal' literal in `compile-test'Brian Templeton1-1/+1
* test-suite/tests/elisp-compiler.test (compile-test): Add `pass-if-equal' to the list of literal identifiers Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07reindentBrian Templeton8-808/+1030
* module/language/elisp/bindings.scm: * module/language/elisp/compile-tree-il.scm: * module/language/elisp/lexer.scm: * module/language/elisp/parser.scm: * module/language/elisp/runtime.scm: * module/language/elisp/runtime/function-slot.scm: * module/language/elisp/runtime/macro-slot.scm: * module/language/elisp/spec.scm: Reindent. Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07reformat commentsBrian Templeton8-384/+409
* module/language/elisp/bindings.scm: * module/language/elisp/compile-tree-il.scm: * module/language/elisp/lexer.scm: * module/language/elisp/parser.scm: * module/language/elisp/runtime.scm: * module/language/elisp/runtime/function-slot.scm: * module/language/elisp/runtime/macro-slot.scm: * module/language/elisp/runtime/value-slot.scm: Reformat comments. Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07whitespace changesBrian Templeton8-115/+71
* module/language/elisp/bindings.scm: * module/language/elisp/compile-tree-il.scm: * module/language/elisp/lexer.scm: * module/language/elisp/parser.scm: * module/language/elisp/runtime.scm: * module/language/elisp/runtime/function-slot.scm: * module/language/elisp/runtime/macro-slot.scm: Ensure that all top-level forms and comments are separated by exactly one newline. Remove blank lines in most procedure bodies. Delete trailing whitespace. Signed-off-by: Andy Wingo <wingo@pobox.com>
2010-12-07autoload compile-file in (guile-user)Brian Templeton1-1/+1
* module/ice-9/boot-9.scm (guile-user): Autoload `compile-file'.
2010-12-07variable-unset!Brian Templeton2-0/+13
* libguile/variable.c (scm_variable_unset_x): New function. * libguile/variable.h (scm_variable_unset_x): New prototype.
2010-12-07unbound fluidsBrian Templeton5-12/+92
* libguile/fluids.c (scm_make_undefined_fluid, scm_fluid_unset_x) (scm_fluid_bound_p): New functions. (fluid_ref): New function; like scm_fluid_ref, but will not throw an error for unbound fluids. (scm_fluid_ref, swap_fluid): Use `fluid_ref'. * libguile/fluids.h (scm_make_undefined_fluid, scm_fluid_unset_x) (scm_fluid_bound_p): New prototypes. * libguile/vm-i-system.c (fluid_ref): If fluid is unbound, jump to `vm_error_unbound_fluid'. * libguile/vm-engine.c (VM_NAME)[vm_error_unbound_fluid]: New error message. * test-suite/tests/fluids.test ("unbound fluids")["fluid-ref of unbound fluid", "fluid-bound? of bound fluid", "fluid-bound? of unbound fluid", "unbound fluids can be set", "bound fluids can be unset"]: New tests.
2010-12-07better unbound variable errors in the vmAndy Wingo2-6/+8
* libguile/vm-i-system.c (variable-ref, toplevel-ref) (long-toplevel-ref): Fixup callers. * libguile/vm-engine.c (vm_error_unbound): Don't use vm-error for unbound vars, use misc-error. Don't include VM: in the string. Take the name directly in finish_args, not as a list.
2010-12-07make guile-test work without configurationBrian Templeton1-5/+8
* test-suite/guile-test: Use "../meta/guile" as the interpreter instead of "../libguile/guile". (default-test-suite): New function, replacing the variable of the same name. Look for tests in the same directory as the guile-test script. Throw an error if not invoked as `guile-test'. (test-suite): The old default value of `default-test-suite' could now throw an error, and this already gets initialized in `main', so don't provide an initial value.
2010-12-06Put `figures' into standard texinfo formNeil Jerram1-25/+22
* doc/ref/goops.texi (Example, Inheritance): Remove unnecessary figure references. Use @float and @ref. (Class precedence list): Ditto.
2010-12-06Merge `tutorial' and `reference' treatments of the same basic GOOPSNeil Jerram2-963/+722
material * doc/ref/goops.texi (GOOPS): Move use of (oop goops) here. (Class Definition): Merged with `Defining New Classes' (Instance Creation): Insert before covering slot options. Merge in material from `Creating Instances'. (Slot Options): Merged some better wording and index entries from the tutorial version. (Slot Description Example): New node, containing the <my-complex> material from the tutorial. (Methods and Generic Functions, Inheritance): Tutorial sections moved into main line of the manual. * doc/ref/goops-tutorial.texi: Nothing left here now.
2010-12-06Minor textual markupsNeil Jerram1-8/+7
* doc/ref/goops-tutorial.texi (Class definition): No reason to assume particular familiarity with CLOS. (Instance creation and slot access): Remove a couple of words.
2010-12-06scm_setvbuf doesn't throw away current buffersAndy Wingo2-3/+21
* libguile/ports.c (scm_drain_input): Slight optimization. * libguile/fports.c (scm_setvbuf): If there is buffered output, flush it. If there is input, drain it, and then unread it after updating the buffers. Much more sensible than dropping it silently...
2010-12-06http-read calls setvbuf only onceAndy Wingo1-6/+2
* module/web/server/http.scm (http-read): Don't play the setvbuf dance, it was throwing away buffered input. Instead just call setvbuf once before doing any reads or writes.