summaryrefslogtreecommitdiff
path: root/module
Commit message (Collapse)AuthorAgeFilesLines
* elisp: boot: Replace removed FRAME-PROCEDURE with FRAME-PROCEDURE-NAME.wip-elispRicardo Wurmus2020-05-191-8/+2
| | | | | | | This is a follow-up to commit e139accb530c970c989b3d53d5a8a22fd75437fc. * module/language/elisp/boot.el (backtrace-frame, guile-backtrace): Use FRAME-PROCEDURE-NAME instead of FRAME-PROCEDURE.
* use standard evaluatorRobin Templeton2020-04-042-3/+1
| | | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/compile-tree-il.scm: Remove import of "(language tree-il eval)". (defmacro): Use standard "eval". * module/language/elisp/runtime.scm: Remove import of "(language tree-il eval)".
* guile-backtrace functionRobin Templeton2020-04-041-2/+5
| | | | | | * module/language/elisp/boot.el (guile-backtrace): New function extracted from `backtrace'. (backtrace): Use it.
* use guile eval for elisp tree-ilRobin Templeton2020-04-043-9/+6
| | | | | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/boot.el (eval): Update with simplified definition. * module/language/elisp/compile-tree-il.scm: Import "(language tree-il eval)". (eval-when-compile): Use eval-elisp. (defmacro): Use eval-tree-il. * module/language/elisp/runtime.scm: Import "(language tree-il eval)". (eval-elisp): Use "eval" to evaluate compiled form within current-module.
* deprecated eval-when situationsRobin Templeton2020-04-041-3/+6
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/compile-tree-il.scm (eval-when): Update.
* execute top level require formsRobin Templeton2020-04-041-0/+4
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/boot.el (require): New compiler macro.
* top level fixesRobin Templeton2020-04-041-2/+2
| | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/compile-tree-il.scm (compile-pair): Use compile-expr-1 instead of compile-expr.
* only evaluate top-level macro definitionsRobin Templeton2020-04-041-3/+4
| | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/compile-tree-il.scm (defmacro): Check to see whether toplevel? is true before compiling a macro.
* degenerate let formsRobin Templeton2020-04-041-6/+8
| | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/compile-tree-il.scm (let): Conditionally invoke make-body within make-dynlet or just on its own depending on whether or not dynamic? is null?.
* eval-whenRobin Templeton2020-04-041-4/+41
| | | | | | | | | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/compile-tree-il.scm (progn): Use compile-expr-1 instead of compile-expr. (toplevel?, compile-time-too?): New fluids. (eval-when): New special form. (compile-expr, compile-expr-1): compile-expr is renamed to compile-expr-1, and compile-expr is now a procedure which, if fulid-ref of toplevel? is true, will call compile-expr-1 with toplevel? fulid bound to #f. Otherwise, continue with compile-expr-1. (compile-tree-il): Set toplevel? and compile-time-too? fluids to #t during evaluation.
* fset macroRobin Templeton2020-04-041-0/+12
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/boot.el (fset): Update to handle macros.
* use defsubstRobin Templeton2020-04-041-5/+13
| | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/boot.el (null, consp, listp, car, cdr): Update to use defsubst. (atom): New variable, using defsubst.
* defsubstRobin Templeton2020-04-041-0/+13
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/boot.el (defsubst): New macro.
* compiler macrosRobin Templeton2020-04-042-0/+24
| | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/boot.el (%define-compiler-macro): New macro. * module/language/elisp/compile-tree-il.scm: New function. (compile-pair): Update to handle %compiler-macro condition.
* defconst, defvar: proclaim special at compile-timeRobin Templeton2020-04-041-0/+3
| | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/compile-tree-il.scm (defconst, defvar): Use proclaim-special!.
* elisp @@ macroRobin Templeton2020-04-041-0/+3
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/boot.el (@@): New macro.
* compile-elisp fnRobin Templeton2020-04-041-0/+5
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/runtime.scm (compile-elisp): New procedure.
* fix symbol-functionRobin Templeton2020-04-041-4/+4
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/runtime.scm (symbol-function): Adjust function.
* restore special operator handlingRobin Templeton2020-04-043-44/+7
| | | | | | | | | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/boot.el (progn, eval-when-compile, if, defconst, defvar, setq, let, flet) (labels, let*, function, defmacro, quote): Removed. * module/language/elisp/compile-tree-il.scm (special-operators): Removed. (compound-pair): Use find-operator to check if a 'special-operator rather than checking the now removed special-operators table. * module/language/elisp/runtime.scm (defspecial): Update to use set-symbol-function!
* define-module for elisp special modulesRobin Templeton2020-04-041-3/+3
| | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/runtime.scm (value-slot-module) (function-slot-module, plist-slot-module): Update to set #:pure to #t.
* constant-interning fixRobin Templeton2020-04-041-1/+2
| | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/system/vm/assembler.scm (intern-constant): Switch from using vector-ref/immediate to make-short-immediate.
* defvar affects default valueRobin Templeton2020-04-041-2/+5
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/compile-tree-il.scm (defvar): Refactor appropriately.
* symbol default value proceduresRobin Templeton2020-04-041-1/+13
| | | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/runtime.scm: (symbol-default-bound?, symbol-default-value, set-symbol-default-value!): New procedure aliases. Export their symbols. (emacs!): Update to accept new parameters dref, dset, dboundp.
* read nil/t as #nil/#tRobin Templeton2020-04-041-12/+18
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/lexer.scm (lex): Update to handle #nil / #t.
* elisp updatesRobin Templeton2020-04-046-263/+583
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/elisp/bindings.scm (get-lexical-binding) (get-function-binding): Use cadr instead of fluid-ref on slot. (with-fluids**): New procedure. (with-symbol-bindings, with-function-bindings): Use with-fluids**. Also stop using "make-fluid", use "(list #f #f)" instead as default lexical-bindings hashtable value. (with-lexical-bindings): Drop the error checking for invalid targets. * module/language/elisp/boot.el (defun, save-excursion) (save-current-buffer, save-restriction, track-mouse, setq-default) (catch, condition-case): New macros. (omega, eval, gensym, interactive, autoload-do-load, fset, prin1) (backtrace-frame, backtrace, %set-eager-macroexpansion-mode): New functions. (null, consp, listp, car, cdr, make-symbol, signal): Wrap in eval-and-compile. (prog1, cond, or, while): Update to make use of gensym. (unwind-protect): Switch from funcall to %funcall. (%functionp): Rename from functionp. (%indirect-function): Update to use %functionp instead of functionp. Add check for if object is null, signaling void-function. Instead of calling symbol-function directly, call via %funcall from the module "(language elisp runtime)". (fset): Significant additions and refactoring. (gload): Renamed from fload. (defvaralias, nthcdr, nth, eq): Move functions to a different location. (eq): Also stop using null. (dolist): Remove quasiquoting, build list manually. (random): Fix indentation. (progn, eval-when-compile, if, defconst, defvar, setq, let, flet) (labels, let*, function, defmacro, quote): Protect as special operators by raising error if invoked as a function. * module/language/elisp/compile-tree-il.scm: Import "(ice-9 format)". Export compile-%function. (lexical-binding, handle-var-def, defun, valid-symbol-list-arg?) (process-options!): Remove. (reference-variable): Adjust functions passed to access-variable. (global?): Drop module parameter, use value-slot instead. (ensure-globals!, set-variable!, parse-body-1, parse-lambda-list) (compile-lambda, defconst, defvar, let, let*, compile-pair): Refactor. (reference-function): Use '(elisp-functions) instead of function-slot. (bind-lexically?): Drop module parameter, simplify. (make-dynlet): Switch from using make-primcall to make-call. (find-operator): Switch from using resolve-interface/resolve-module to using function-slot. (if, defconst, defvar, let, let*, flet, labels, guile-ref) (guile-private-ref, guile-primitive, defmacro, `, quote, %funcall) (%set-lexical-binding-mode): Add error checking. (setq): Pass in args to report-error. (function): Simplified, now calling %function. (%function): New function, based on prior "function". Refactor, including adding support for matching against a closure. (%set-lexical-binding-mode): Switch from using fluid-set! to set-lexical-binding-mode. (special-operators): New variable. Build from following for-each statement. (compile-tree-il): Drop call to "process-options!" * module/language/elisp/lexer.scm: Import "(language elisp runtime)". (lex): Switch from using "list->string" to "make-lisp-string". * module/language/elisp/runtime.scm: Use modules "(ice-9 format)", "(system base compile)". Remove from export list list, removing ensure-fluid!, symbol-fluid!, set-symbol-fluid!. Add to export list ensure-dynamic!, symbol-name, symbol-plist, set-symbol-plist!, bind-symbol, symbol-desc, proclaim-symbol! special? emacs! unbound, lexical-binding?, set-lexical-binding-mode, log!, eval-elisp, local-eval-elisp, make-lisp-string, lisp-string? (make-list-string, lisp-string?) New function aliases. (value-slot-module, function-slot-module): Adjust module resolution. (nil_, t_): New variables. (ensure-fluid!, symbol-fluid, set-symbol-fluid!): Removed. (lexical-binding, unbound): New variables. (lexical-binding?, set-lexical-binding-mode, unbound, dynamic?) (make-dynamic, dynamic-ref, dynamic-set!, dynamic-unset!) (dynamic-bound?, dynamic-bind, ensure-present!, ensure-desc!) (schemify, symbol-name, symbol-desc, ensure-dynamic!, symbol-dynamic) (set-symbol-plist!, special?, proclaim-special!, emacs!, eval-elisp) (make-string): New procedures. (symbol-value): Use dynamic-ref! instead of fluid-ref!. (set-symbol-value!): Use dynamic-set! instead of fluid-set!. (symbol-function, set-symbol-function!, symbol-bound?) (symbol-fbound?, makunbound!, fmakunbound!): Refactor, including adjusting how module resolution is being done. * module/language/elisp/spec.scm: Import module "(system vm vm)". Setup elisp-symbols, elisp-functions, elisp-plists. Use "set-default-vm-engine!" and "set-vm-engine!" to be set to 'debug. (elisp): Comment out joiner.
* prefer compilers earlier in listRobin Templeton2020-04-041-2/+2
| | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/system/base/compile.scm (find-language-joint): Change order of cond.
* allow arbitrary constants in cpsRobin Templeton2020-04-041-2/+1
| | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/language/cps/types.scm (constant-type): No longer error if type not determined. Return &all-types instead.
* guile-private-refBT Templeton2020-04-042-0/+8
| | | | | * module/language/elisp/compile-tree-il.scm (compile-guile-private-ref): New special operator.
* check symbols constants uninternedRobin Templeton2020-04-041-1/+1
| | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * module/system/vm/assembler.scm (intern-constant, link-data): Update to check "symbol-interned?".
* intern arbitrary constantsRobin Templeton2020-04-044-10/+47
| | | | | | | | | | | | | | | | | | | | | | | | (Best-ability ChangeLog annotation added by Christopher Allan Webber.) * libguile/loader.c (load_thunk_from_memory): Refactor, adding "constants" argument and passing to "init" if appropriate. (load_thunk_from_file): Call "load-thunk-from-memory" with "constants" set to #f. (scm_load_thunk_from_memory): Instead of a bytevector, accept a cons of "(bytevector . constants)", where constants is either a vector or #f. Pass this into "load_thunk_from_memory". * module/language/bytecode/spec.scm: Adapt printer. * module/language/cps/compile-bytecode.scm (compile-bytecode): New variable. * module/system/repl/command.scm (disassemble): Adapt to expect pair which includes bytevector as its car. * module/system/vm/assembler.scm <asm>: Add "to-file?" slot. (fresh-block): New variable. (make-assembler): Adapt to expect "to-file?" keyword argument. (intern-constant): Support "asm-to-file?" in checks. (emit-init-constants, link-data): Likewise. (link-assembly): Update logic for handling "(bytevector . constants)" pair, as well as the expectations of its invocation by compile-bytecode.
* Fix fixpoint computation in compute-significant-bitsAndy Wingo2020-03-231-2/+23
| | | | | | | | * module/language/cps/specialize-numbers.scm (preserve-eq?): New helper. (sigbits-union): Use the new helper. Fixes bugs.gnu.org/38486. Thanks to Zack Marvel for the bug report and Matt Wette for tracking it down.
* Bump user-visible copyright years to 2020Andy Wingo2020-03-072-4/+4
| | | | | * module/ice-9/command-line.scm (version-etc): * module/scripts/compile.scm (show-version): Bump to 2020.
* Remove duplicate procedure in slot-allocation.scm.Ludovic Courtès2020-02-121-15/+12
| | | | | | * module/language/cps/slot-allocation.scm (add-live-slot) (kill-dead-slot, compute-slot): Move higher up in the file. (compute-shuffles): Remove duplicate 'add-live-slot' procedure.
* texinfo: Properly render @acronym in plain text.Ludovic Courtès2020-02-121-1/+12
| | | | | | | | | | | Fixes <https://bugs.gnu.org/37846>. Reported by Christopher Baines <mail@cbaines.net>. * module/texinfo/plain-text.scm (acronym): New procedure. (tag-handlers): Change 'acro' handle to ACRONYM, and add 'acronym' handler. * test-suite/tests/texinfo.plain-text.test ("stexi->plain-text") ["acronym", "recursive acronym"]: New tests.
* texinfo: Add '*line-width*' fluid to control line wrapping.Ludovic Courtès2020-02-121-4/+7
| | | | | | | | * module/texinfo/plain-text.scm (*line-width*): New variable. (wrap*): Honor it. * doc/ref/texinfo.texi (texinfo plain-text): Document it. * test-suite/tests/texinfo.plain-text.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add it.
* Fix peval bug that ignored excess argsAndy Wingo2020-01-121-2/+2
| | | | | | | | * module/language/tree-il/peval.scm (peval): Fix arity check for type confusion (empty value of "rest" in this context was (), not #f). The effect was that we'd silently allow extra arguments to inlined calls. Thanks to Christopher Lam for the report! Fixes #38617. * test-suite/tests/peval.test ("partial evaluation"): Add a test.
* web: Update comment regarding the 'tls-wrap' port wrapper.Ludovic Courtès2020-01-031-7/+10
| | | | * module/web/client.scm (tls-wrap): Update comment.
* REPL server: Avoid deprecated '_IOFBF'.Ludovic Courtès2019-06-301-1/+1
| | | | | * module/system/repl/server.scm (drain-input-and-close): Use 'block instead of _IOFBF.
* ports: Export 'current-load-port'.Ludovic Courtès2019-06-301-1/+2
| | | | | | | | This binding was forgotten when (ice-9 ports) was introduced in 44b3342c4d5ebd4bbf21c7c7608a5f1a53ba0eb4. Thus it has always been missing in Guile 2.2. * module/ice-9/ports.scm: Export 'current-load-port'.
* Revert "web: Add support for HTTP header continuation lines."Mark H Weaver2019-06-241-24/+7
| | | | | | Fixes <https://bugs.gnu.org/36350>. This reverts commit 73cde5ed7218a090ecee888870908af5445796f0.
* Remove references to 'inet-ntoa' and 'inet-aton'.Ludovic Courtès2019-06-241-2/+4
| | | | | | | | | | | | These procedures were removed in Guile 2.2 by commit fc7bd367ab4b5027a7f80686b1e229c62e43c90b (May 2011). * libguile/socket.h (scm_inet_aton, scm_inet_ntoa): Remove. * module/system/repl/server.scm (make-tcp-server-socket): Use 'inet-pton' instead of 'inet-aton'. * doc/ref/web.texi (HTTP): Likewise in 'declare-header!' example. * doc/ref/posix.texi (Network Address Conversion): Remove documentation of 'inet-ntoa' and 'inet-aton'.
* stexi->shtml: Add support for @i, @math, @tie and @dots.Christopher Baines2019-06-181-0/+4
| | | | | | * module/texinfo/html.scm (tag-replacements): Add support for @i and @math. The tags used come from the texinfo documentation. (rules): Convert @tie and @dots to the appropriate HTML entities.
* Avoid regexp ranges in HTTP inter-protocol exploitation check.Mark H Weaver2019-06-181-1/+1
| | | | | * module/system/repl/server.scm (permissive-http-request-line?): Avoid character ranges in regexp.
* web: Add support for HTTP header continuation lines.Mark H Weaver2019-06-181-7/+24
| | | | | | | * module/web/http.scm (spaces-and-tabs, space-or-tab?): New variables. (read-header-line): After reading a header, if a space or tab follows, read the continuation lines and join them. * test-suite/tests/web-http.test: Add test.
* Make 'get-bytevector-n!' suspendable.Mark H Weaver2019-06-181-45/+67
| | | | | | * module/ice-9/suspendable-ports.scm (get-bytevector-n!): New procedure. (get-bytevector-n): Rewrite in terms of 'get-bytevector-n!'. (port-bindings): Add 'get-bytevector-n!'.
* SRFI-19: Rename 'tai-epoch-in-jd' to 'utc-epoch-in-jd'.Mark H Weaver2019-06-181-11/+11
| | | | | * module/srfi/srfi-19.scm: Rename 'tai-epoch-in-jd' to 'utc-epoch-in-jd', to reflect its actual meaning and usage.
* Fix documentation of R6RS 'binary-port?' to reflect reality.Mark H Weaver2019-06-181-5/+13
| | | | | | | * doc/ref/r6rs.texi (rnrs io ports): Improve the descriptions of 'binary-port?' and 'textual-port?'. * module/rnrs/io/ports.scm (binary-port?, textual-port?): Update the docstrings.
* Make 'get-bytevector-some' and 'get-bytevector-some!' suspendable.Mark H Weaver2019-06-181-1/+30
| | | | | | * module/ice-9/suspendable-ports.scm (get-bytevector-some) (get-bytevector-some!): New procedures. (port-bindings): Add them.
* open-pipe*: Improve performance of OPEN_BOTH mode.Mark H Weaver2019-06-181-14/+45
| | | | | * module/ice-9/popen.scm (make-rw-port): Re-implement using R6RS custom binary input/output ports.
* Add get-bytevector-some!.Mark H Weaver2019-06-181-0/+1
| | | | | | | | * libguile/r6rs-ports.c (scm_get_bytevector_some_x): New procedure. * libguile/r6rs-ports.h (scm_get_bytevector_some_x): Add prototype. (scm_unget_bytevector): Move prototype next to 'scm_get_bytevector_some_x'. * module/ice-9/binary-ports.scm: Export 'get-bytevector-some!'. * doc/ref/api-io.texi (Binary I/O): Document it.