1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

31 commits

Author SHA1 Message Date
BT Templeton
ebc30e3fde length's argument is a sequence
* module/language/elisp/boot.el (length): Use `length' if the argument
  is a list or `generalized-vector-length' otherwise.
2012-04-01 15:59:42 -04:00
BT Templeton
52d2472441 elisp rng
* module/language/elisp/boot.el (random): New function.
2012-03-08 17:08:30 -05:00
BT Templeton
43ff6804d6 elisp i/o
* module/language/elisp/boot.el (send-string-to-terminal)
  (read-from-minibuffer, prin1-to-string): New functions.
2012-03-08 17:08:30 -05:00
BT Templeton
5c65ee510f elisp: symbol-name, intern
* module/language/elisp/boot.el (symbol-name, intern): New functions.
2012-03-08 17:08:30 -05:00
BT Templeton
c0652730bc elisp: when, unless
* module/language/elisp/boot.el (when, unless): New macros.
2012-03-08 17:08:30 -05:00
BT Templeton
12c00a0453 elisp sequence functions
* module/language/elisp/boot.el (nreverse, assoc, assq, rplaca, rplacd)
  (caar, cadr, cdar, cddr, dolist, stringp, string-equal, string=)
  (substring, upcase, downcase, string-match, make-vector, mapc, aref)
  (aset, concat): New functions.
2012-03-08 17:08:30 -05:00
BT Templeton
fc45b7e8e8 integerp, wholenump return nil for non-numbers
* module/language/elisp/boot.el (integerp, wholenump): Call `integer?'
  before `exact?' so that these predicates return nil for non-numbers
  instead of signalling an error.
2012-03-08 17:08:30 -05:00
BT Templeton
39864d2014 elisp I/O
* module/language/elisp/boot.el (princ, print, terpri, format*): New
  functions.
2012-02-03 18:53:50 -05:00
BT Templeton
b07a74497a more lexical declarations
* module/language/elisp/boot.el (condition-case, catch): Add `lexical'
  declarations in macro expansions.
2012-02-03 18:53:50 -05:00
BT Templeton
85b3dd6cc2 signal an error for uncaught throws
* module/language/elisp/boot.el (%catch): New variable.

  (catch): Bind `%catch' to `t' during the evaluation of `body'. Call
  `throw' instead of signalling an exception directly.

  (throw): Signal a `no-catch' error if there is no `catch' to throw to.
2012-02-03 18:53:50 -05:00
BT Templeton
8fb678718c catch' in terms of condition-case'
* module/language/elisp/boot.el (throw): Define an `error-conditions'
  property for this symbol.

  (catch): Define in terms of `condition-case' instead of using Guile
  exceptions directly.

  (throw): Signal a `throw' condition instead of throwing a Guile
  exception directly.
2012-02-03 18:53:50 -05:00
BT Templeton
ce9b7cc22c standard error symbols
* module/language/elisp/boot.el (error, wrong-type-argument, no-catch,
  invalid-function): Define `error-conditions' properties for these
  standard error symbols.
2012-02-03 18:53:50 -05:00
BT Templeton
76c50ec52e `%plist-member' fix
* module/language/elisp/boot.el (%plist-member): Use recursion to avoid
  using `catch' and `throw'.
2012-02-03 18:53:50 -05:00
BT Templeton
5950f674bf condition-case
* module/language/elisp/boot.el (signal): Accept only two arguments, and
  throw an `elisp-condition' exception instead of an `elisp-error'
  exception.
  (condition-case): New macro.
2012-02-03 18:53:50 -05:00
BT Templeton
df9cd3b447 elisp `member' subrs
* module/language/elisp/boot.el (%member, member, memql, memq): New
  functions.
2012-02-03 18:53:50 -05:00
BT Templeton
9083c48d37 lexical binding macros
* module/language/elisp/boot.el (lexical-let, lexical-let*): New macros.

* module/language/elisp/compile-tree-il.scm (bind-lexically?): Remove
  the check for a `lexical' flag, since `lexical-let' and `lexical-let*'
  are no longer special operators.

  (compile-lexical-let, compile-lexical-let*): Remove.

* module/language/elisp/runtime/function-slot.scm: Update module
  definition.
2012-02-03 18:53:50 -05:00
BT Templeton
13f022c9f7 use `lexical' declarations in "boot.el"
* module/language/elisp/boot.el (prog1, cond, or, catch): Use `let' with
  `lexical' declarations instead of `lexical-let'.
  (%plist-put): Use `let' instead of `lexical-let', since "boot.el" now
  uses lexical binding by default.
2012-02-03 18:53:50 -05:00
BT Templeton
9b90b45398 elisp `while' macro
* module/language/elisp/compile-tree-il.scm (compile-while): Remove.

* module/language/elisp/boot.el (while): New macro.

* module/language/elisp/runtime/function-slot.scm: Update module
  definition.
2012-02-03 18:53:50 -05:00
BT Templeton
b05ca4abb9 elisp function subrs
* module/language/elisp/boot.el (null, consp, listp, car, cdr)
  (make-symbol, signal): Use `%funcall' instead of `funcall' or `fset'.
  (symbolp, symbol-function, eval): Use `%funcall', since `funcall' now
  calls these functions.

  (functionp, %indirect-function): New functions.
  (funcall): Define in terms of `%funcall' and `%indirect-function'.
  (apply): New function. Previously defined in
  "module/language/elisp/runtime/subrs.scm".

  (fset): If `definition' is not a function, set the function cell of
  `symbol' to an falias for `definition'.

* module/language/elisp/falias.scm: New file.

* module/language/elisp/subrs.scm: Remove file.
  (apply): Remove. Now defined in "boot.el".
* module/language/elisp/runtime/function-slot.scm: Update module
  definition.

* module/Makefile.am: Update.
2012-02-03 18:53:49 -05:00
BT Templeton
0ab2a63af1 elisp nil equality
* module/language/elisp/boot.el (eq, equal): Return `#t' if both
  arguments are nil.
  (eql): New function.
2012-02-03 18:53:49 -05:00
BT Templeton
ddc9006b5d use lexical binding in boot.el
* module/language/elisp/boot.el: Use lexical binding.
2012-02-03 18:53:49 -05:00
BT Templeton
5bcc6d9e70 rewrite eval' and load' in elisp
* module/language/elisp/subrs.scm (eval, load): Rewrite in Elisp and
  move to...
* module/language/elisp/boot.el (eval, load): ...here.
2012-02-03 18:53:49 -05:00
BT Templeton
14b288ceb9 elisp variable aliases
* module/language/elisp/boot.el (defvaralias): New function.
2012-02-03 18:53:49 -05:00
BT Templeton
85bc6238bf simplify elisp symbol accessors
* module/language/elisp/boot.el (fset, symbol-value, symbol-function)
  (set, makunbound, fmakunbound, boundp, fboundp): Use procedures in
  `(language elisp runtime)'.
  (symbolp): New function.

* module/language/elisp/compile-tree-il.scm (set-variable!): Use
  `set-symbol-function!'.

* module/language/elisp/runtime.scm (reference-variable, set-variable!):
  Remove.
  (symbol-fluid, set-symbol-fluid!): New procedure.
  (symbol-value, set-symbol-value!, symbol-function)
  (set-symbol-function!, symbol-bound?, symbol-fbound?, makunbound!)
  (fmakunbound!): Moved from `(language elisp subrs)' and updated to
  avoid using `reference-variable' and `set-variable!'.

* module/language/elisp/runtime/subrs.scm (symbol-value)
  (symbol-function, set, fset, makunbound, fmakunbound, boundp)
  (fboundp): Move to `(language elisp runtime)'.
  (apply): Use `symbol-function'.
2012-02-03 18:53:49 -05:00
BT Templeton
12ca82caa2 elisp property lists
* module/language/elisp/boot.el (%plist-member, %plist-get, %plist-put)
  (plist-get, plist-put, plist-member, lax-plist-get, lax-plist-put)
  (symbol-plist, setplist, get, put): New functions.
  (plist-function): New variable.
2012-02-03 18:53:49 -05:00
BT Templeton
5fa5bf7d10 fix elisp `catch'
* module/language/elisp/boot.el (catch): Only catch exceptions of type
  `elisp-exception'.
2012-02-03 18:53:48 -05:00
BT Templeton
97d9da9a87 implement `throw' in elisp
* module/language/elisp/runtime/subrs.scm (throw): Rewrite in Elisp and
  move to...
* module/language/elisp/boot.el (throw): ...here.
2012-02-03 18:53:48 -05:00
BT Templeton
b652e2b93f rewrite elisp macros in elisp
* module/language/elisp/runtime/macros.scm: Remove.
  (macro-lambda, macro-prog1, macro-prog2, macro-cond, macro-and,
  macro-or, macro-catch, macro-unwind-protect): Rewrite in Elisp and
  move to...
* module/language/elisp/boot.el (lambda, prog1, prog2, cond, and, or,
  catch, unwind-protect): ...here.
  (eval-and-compile): New macro.
  (funcall, fset, null, consp, listp, car, cdr, make-symbol-signal):
  Wrap definitions in an `eval-and-compile' form so that they can be
  used by the rewritten macros.
* module/language/elisp/runtime.scm: Remove `built-in-macro'.
* module/language/elisp/Makefile.am: Remove
  module/language/elisp/runtime/macros.scm from `ELISP_LANG_SOURCES'.
2012-02-03 18:53:48 -05:00
BT Templeton
8f2f65668a new string' and mapcar' elisp subrs
* module/language/elisp/boot.el (string, mapcar): New functions.
2012-02-03 18:53:48 -05:00
BT Templeton
9b15703d79 rewrite elisp subrs in elisp
* module/language/elisp/runtime/subrs.scm (%, *, +, -, /=, 1+, 1-, <)
  (<=, =, >, >=, abs, append, atom, car, car-safe, cdr, cdr-safe, cons)
  (consp, eq, equal, fceiling, ffloor, float, floatp, fround, ftruncate)
  (funcall, integerp, length, list, listp, make-list, max, min, nlistp)
  (nth, nthcdr, null, numberp, reverse, setcar, setcdr, wholenump)
  (zerop): Rewrite in Elisp and move to...
* module/language/elisp/boot.el: ...here. Some functions have stricter
  type checking, and `elisp-bool' is not currently used (so some
  predicate functions now return `#f' instead of `#nil').
  (boundp, eval, fboundp, fmakunbound, fset, load, makunbound, set)
  (symbol-function, symbol-value, throw): New functions; they call their
  existing implementations in subrs.scm.
  (@): New macro.
* module/language/elisp/runtime.scm (built-in-func): Remove. All uses
  changed.
* module/language/elisp/runtime/function-slot.scm: Update module
  definition.
2012-02-03 18:53:48 -05:00
BT Templeton
6937c7aa8b load boot.el
* am/guilec: Add support for compiling Elisp files.
* module/Makefile.am: New variable ELISP_SOURCES.
* module/language/elisp/boot.el: New file.
* module/language/elisp/spec.scm: Load boot.el.
2011-11-22 15:06:12 -05:00