summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lexical function binding for elispwip-bpt-elispBrian Templeton2010-08-164-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*"]:
* use unbound fluids instead of `void' sentinel valueBrian Templeton2010-08-156-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.
* variable-unset!Brian Templeton2010-08-152-0/+13
| | | | | * libguile/variable.c (scm_variable_unset_x): New function. * libguile/variable.h (scm_variable_unset_x): New prototype.
* unbound fluidsBrian Templeton2010-08-155-13/+90
| | | | | | | | | | | | | | | | | | | | | | * 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.
* function's argument can be a symbolBrian Templeton2010-08-151-1/+3
| | | | | * module/language/elisp/compile-tree-il.scm (compile-function): the form `(function SYMBOL)' evaluates to the functional value of SYMBOL
* allow `(setcar nil nil)' and `(setcdr nil nil)'Brian Templeton2010-08-151-2/+6
| | | | | * module/language/elisp/runtime/subrs.scm (setcar, setcdr): Allow setting the car or cdr of `nil' to `nil'.
* support "#'" syntax for function expressionsBrian Templeton2010-08-152-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.
* autoload compile-file in (guile-user)Brian Templeton2010-08-131-1/+1
| | | | * module/ice-9/boot-9.scm (guile-user): Autoload `compile-file'.
* make guile-test work without configurationBrian Templeton2010-08-131-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.
* add .dir-locals for elispBrian Templeton2010-08-131-0/+3
| | | | * module/language/elisp/.dir-locals.el: New file. Set fill-column to 72.
* setq can take any number of argumentsBrian Templeton2010-08-131-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.
* use correct names for quasiquotation operatorsBrian Templeton2010-08-135-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.
* store special operators in the function slotBrian Templeton2010-08-134-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.
* update elisp reader tests to handle EOF tokensBrian Templeton2010-08-131-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*'.
* make user-defined macros available at runtimeBrian Templeton2010-08-131-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'.
* allow fluid macro bindingsBrian Templeton2010-08-131-2/+4
| | | | | * module/language/elisp/compile-tree-il.scm (define-macro!, get-macro): Allow fluid macro bindings.
* new `load' subrBrian Templeton2010-08-132-1/+7
| | | | | * module/language/elisp/runtime/subrs.scm: Define new subr `load'. * module/language/elisp/runtime/function-slot.scm: Re-export `load'.
* Ignore #:warnings compiler optionBrian Templeton2010-08-131-0/+2
| | | | | * module/language/elisp/compile-tree-il.scm (process-options!): Ignore #:warnings compiler option.
* handle EOF correctly in parser and lexerBrian Templeton2010-08-132-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.
* add new elisp files to module/Makefile.amBrian Templeton2010-08-131-1/+2
|
* make `pass-if-equal' literal in `compile-test'Brian Templeton2010-08-131-1/+1
| | | | | * test-suite/tests/elisp-compiler.test (compile-test): Add `pass-if-equal' to the list of literal identifiers
* store macro definitions in the function slotBrian Templeton2010-08-135-352/+451
| | | | | | | | | | | | | | | | | | | | | | | 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".
* use existing bindings record for defmacroBrian Templeton2010-08-131-2/+1
| | | | | * module/language/elisp/compile-tree-il.scm (compile-pair): Use existing bindings record during macro definition.
* use tree-il's support for optional argumentsBrian Templeton2010-08-131-189/+101
| | | | | | * module/language/elisp/compile-tree-il.scm (compile-lambda): Use Tree-IL's support for optional arguments. (process-optionals, process-rest): Remove.
* reindentBrian Templeton2010-08-138-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.
* reformat commentsBrian Templeton2010-08-138-450/+478
| | | | | | | | | | | * 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.
* whitespace changesBrian Templeton2010-08-138-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.
* Explicit definitions for `memp' and `assp' in `(rnrs list)'; the predicateJulian Graham2010-08-083-2/+35
| | | | | | | | | | | argument to Guile's `member' and `assoc' functions has a different expected arity. * module/rnrs/lists.scm (memp, assp): Wrap the predicate function with a two-argument wrapper before calling Guile's underlying implemenation. * test-suite/Makefile.am: Add test-suite/tests/r6rs-lists.test to SCM_TESTS. * test-suite/tests/r6rs-lists.test: New file.
* Explicit definitions for `vector-for-each' and `vector-map'; Guile's SRFI-1Julian Graham2010-08-083-2/+39
| | | | | | | | | `for-each' and `map' implementations do not operate on lists and vectors interchangeably. * module/rnrs/base.scm (vector-for-each, vector-map): New functions. * test-suite/Makefile.am: Add test-suite/tests/r6rs-base.test to SCM_TESTS. * test-suite/tests/r6rs-base.test: New file.
* further rnrs incompat noteAndy Wingo2010-08-081-0/+4
| | | | * doc/ref/r6rs.texi: Note about rnrs io ports.
* loose ends from "discouraged" removalAndy Wingo2010-08-086-56/+37
| | | | | | | | | | | | * README: Remove docs on "discouraged". * configure.ac: Remove one more "discouraged" thing. * doc/ref/api-deprecated.texi: Rename from api-discdepr.texi, and remove sections on "discouraged". * doc/ref/Makefile.am: * doc/ref/guile.texi: Update referrers.
* remove "discouraged" infrastructureAndy Wingo2010-08-0813-123/+77
| | | | | | | | | | | | | | | | | | | | | * libguile/discouraged.h: Remove. * libguile/deprecated.c (scm_internal_select, scm_thread_sleep) (scm_thread_usleep): Deprecate formerly discouraged names. * libguile/eq.h (SCM_EQ_P): * libguile/pairs.h (SCM_NULLP, SCM_NNULLP, SCM_CONSP, SCM_NCONSP): * libguile/boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOLP, SCM_BOOL): (SCM_NEGATE_BOOL, SCM_BOOL_NOT): Undiscourage these names, because I'm not sure deprecating them will do any good. * libguile.h: * libguile/gen-scmconfig.c: * libguile/numbers.c: * libguile/init.c: * libguile/Makefile.am: * configure.ac: Remove bits that referenced discouraged.h, and dealt with the "discouraging" system.
* deprecated all discouraged functionsAndy Wingo2010-08-088-434/+458
| | | | | | | | | | | | | | | | * libguile/Makefile.am: * libguile/discouraged.c: Remove discouraged.c. * libguile/deprecated.c: * libguile/deprecated.h: * libguile/discouraged.h: All functions and declarations moved from discouraged.[ch] to deprecated.[ch], adding deprecation warnings. * libguile/init.c: Remove discouraged init. * libguile/numbers.c (scm_num2float, scm_num2double): Deprecate. * test-suite/standalone/test-num2integral.c: Port to modern API.
* more r6rs incompatAndy Wingo2010-08-081-0/+6
| | | | | * doc/ref/r6rs.texi (R6RS Incompatibilities): Add section on string syntax.
* add section on toplevel expansion to r6rs incompatibilitiesAndy Wingo2010-08-081-0/+44
| | | | | * doc/ref/r6rs.texi (R6RS Incompatibilities): Add a section about toplevel expansion, before taking a look at fixing it...
* more NEWS updatesAndy Wingo2010-08-061-8/+4
| | | | * NEWS: Update some more.
* fix stack narrowing for tail-call to throwAndy Wingo2010-08-061-1/+5
| | | | | * module/system/repl/debug.scm (narrow-stack->vector): Fix for the tail-call to `throw' case, as in `(quit)'.
* ,x unbound does not quit replAndy Wingo2010-08-061-3/+13
| | | | | * module/system/repl/repl.scm (run-repl): Catch errors executing metacommands. Feature on top of feature...
* update NEWS for 1.9.12 (mostly)Andy Wingo2010-08-061-6/+336
| | | | * NEWS: Update for 1.9.12.
* add docs for extensiondir; misc other fixesAndy Wingo2010-08-062-35/+29
| | | | | | | | | * libguile/foreign.c (scm_i_pointer_print): Print in hexadecimal. * doc/ref/api-foreign.texi (Modules and Extensions): Update for "extensiondir", and a discussion of Guile versions. (Foreign Variables): Fix discussion of types. (Void Pointers and Byte Access): Fix typo.
* remove type discusison from dynamic-pointer docstringAndy Wingo2010-08-062-10/+0
| | | | | | * doc/ref/api-foreign.texi: * libguile/dynl.c (scm_dynamic_pointer): Remove discussion of types from the docstring.
* s/extensionsdir/extensiondir/Andy Wingo2010-08-062-2/+2
| | | | | | * libguile/Makefile.am (libpath.h): Change "extensionsdir" to "extensiondir". * meta/guile-2.0.pc.in (extensiondir): Likewise.
* %site-dir is specific to the effective versionAndy Wingo2010-08-063-5/+21
| | | | | | | | | | | | * libguile/load.h: * libguile/load.c (scm_sys_global_site_dir): New API, is what %site-dir used to be. (scm_sys_site_dir): Changed to be a version-specific dir. (scm_init_load_path): Search the version-specific sitedir before the global one. * libguile/Makefile.am (libpath.h): Update SCM_SITE_DIR and SCM_GLOBAL_SITE_DIR, as appropriate.
* only one Value History sectionAndy Wingo2010-08-063-36/+3
| | | | | | | | * doc/ref/repl-modules.texi: Remove section on Value History, it's covered in scheme-using. * doc/ref/scheme-using.texi: Rename "Value Historyx" section to "Value History". * doc/ref/guile.texi: Update xref.
* add settable identifier syntax docsAndy Wingo2010-08-061-4/+62
| | | | | * doc/ref/api-macros.texi (Identifier Macros): Add documentation for settable identifier syntax.
* letrec* in docs, and some r6rs fixesAndy Wingo2010-08-065-70/+92
| | | | | | | | | | * doc/ref/api-binding.texi: Add docs for letrec*, and revise some other text. * doc/ref/compiler.texi: Update <letrec> for in-order?. * doc/ref/r6rs.texi: Add letrec* entry. * module/rnrs.scm: * module/rnrs/base.scm: Export letrec*.
* fold 1.9.11 news into main bodyAndy Wingo2010-08-051-251/+132
| | | | * NEWS: Update.
* fix vector-move-right! and vector-move-left!Andy Wingo2010-08-042-3/+88
| | | | | | | | | | * libguile/vectors.c (scm_vector_move_left_x, scm_vector_move_right_x): Fix some bugs reported by Michael Lucy -- both variants would happily write beyond the end, and vector-move-right! didn't increment the counter before copying in the reverse direction. * test-suite/tests/vectors.test ("vector-move-left!"): ("vector-move-right!"): Add tests.
* Compiling DOT_X_FILES requires version.hYan Li2010-08-041-1/+1
| | | | | | | | | There was a race condition when building Guile since DOT_X_FILES didn't depend on version.h, which is dynamically generated. Sometimes the DOT_X_FILES are compiled before the version.h is generated and leads to build failure. This patch fixed this problem. Signed-off-by: Yan Li <yan.i.li@intel.com>
* Fix the range of `random' on 64-bit platformsAndreas Rottmann2010-08-012-15/+28
| | | | | | | | | | | | For > 32 bit integers still in the fixnum range, scm_random() would return random numbers with a lower range than specified. * libguile/random.c (scm_i_mask32): New static inline function. (scm_c_random): Use `scm_i_mask32'. (scm_c_random64): New function, 64-bit variant of scm_c_random. (scm_random): Use `scm_c_random64' instead of forming the 64-bit random number in a bogus way. * libguile/random.h: Added `scm_c_random64'.