[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, master, updated. v2.1.0-185-g52d2472
From: |
BT Templeton |
Subject: |
[Guile-commits] GNU Guile branch, master, updated. v2.1.0-185-g52d2472 |
Date: |
Thu, 08 Mar 2012 22:18:39 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=52d2472441891cbb85ec23d16e685d91c5ed8bfd
The branch, master has been updated
via 52d2472441891cbb85ec23d16e685d91c5ed8bfd (commit)
via 43ff6804d64f4db680961849a12decd34e571416 (commit)
via 5c65ee510f98940397b9d69d4020f588ec9f95a8 (commit)
via c0652730bcbb769c732fbc459f5852077fded5c6 (commit)
via 12c00a0453bd877030509bba93cf6113dc4c468d (commit)
via fc45b7e8e826d2e870f6e316749f87c20d083cb1 (commit)
from bc612809929b85fdcb39bc17a15a53c88b43a8bd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 52d2472441891cbb85ec23d16e685d91c5ed8bfd
Author: BT Templeton <address@hidden>
Date: Wed Mar 7 20:09:21 2012 -0500
elisp rng
* module/language/elisp/boot.el (random): New function.
commit 43ff6804d64f4db680961849a12decd34e571416
Author: BT Templeton <address@hidden>
Date: Wed Mar 7 20:08:46 2012 -0500
elisp i/o
* module/language/elisp/boot.el (send-string-to-terminal)
(read-from-minibuffer, prin1-to-string): New functions.
commit 5c65ee510f98940397b9d69d4020f588ec9f95a8
Author: BT Templeton <address@hidden>
Date: Wed Mar 7 20:06:54 2012 -0500
elisp: symbol-name, intern
* module/language/elisp/boot.el (symbol-name, intern): New functions.
commit c0652730bcbb769c732fbc459f5852077fded5c6
Author: BT Templeton <address@hidden>
Date: Wed Mar 7 20:05:16 2012 -0500
elisp: when, unless
* module/language/elisp/boot.el (when, unless): New macros.
commit 12c00a0453bd877030509bba93cf6113dc4c468d
Author: BT Templeton <address@hidden>
Date: Wed Mar 7 20:04:46 2012 -0500
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.
commit fc45b7e8e826d2e870f6e316749f87c20d083cb1
Author: BT Templeton <address@hidden>
Date: Wed Mar 7 14:34:13 2012 -0500
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.
-----------------------------------------------------------------------
Summary of changes:
module/language/elisp/boot.el | 128 +++++++++++++++++++++++++++++++++++++++--
1 files changed, 123 insertions(+), 5 deletions(-)
diff --git a/module/language/elisp/boot.el b/module/language/elisp/boot.el
index bec32b5..53711e1 100644
--- a/module/language/elisp/boot.el
+++ b/module/language/elisp/boot.el
@@ -131,6 +131,14 @@
#'(lambda () ,bodyform)
#'(lambda () ,@unwindforms)))
+(defmacro when (cond &rest body)
+ `(if ,cond
+ (progn ,@body)))
+
+(defmacro unless (cond &rest body)
+ `(when (not ,cond)
+ ,@body))
+
(defun symbolp (object)
(%funcall (@ (guile) symbol?) object))
@@ -214,12 +222,14 @@
;;; `symbolp' and `symbol-function' are defined above.
+(fset 'symbol-name (@ (guile) symbol->string))
(fset 'symbol-value (@ (language elisp runtime) symbol-value))
(fset 'set (@ (language elisp runtime) set-symbol-value!))
(fset 'makunbound (@ (language elisp runtime) makunbound!))
(fset 'fmakunbound (@ (language elisp runtime) fmakunbound!))
(fset 'boundp (@ (language elisp runtime) symbol-bound?))
(fset 'fboundp (@ (language elisp runtime) symbol-fbound?))
+(fset 'intern (@ (guile) string->symbol))
(defun defvaralias (new-alias base-variable &optional docstring)
(let ((fluid (funcall (@ (language elisp runtime) symbol-fluid)
@@ -237,16 +247,14 @@
(null (funcall (@ (guile) integer?) object)))))
(defun integerp (object)
- (and (funcall (@ (guile) exact?) object)
- (funcall (@ (guile) integer?) object)))
+ (and (funcall (@ (guile) integer?) object)
+ (funcall (@ (guile) exact?) object)))
(defun numberp (object)
(funcall (@ (guile) real?) object))
(defun wholenump (object)
- (and (funcall (@ (guile) exact?) object)
- (funcall (@ (guile) integer?) object)
- (>= object 0)))
+ (and (integerp object) (>= object 0)))
(defun zerop (object)
(= object 0))
@@ -310,6 +318,7 @@
(fset 'make-list (@ (guile) make-list))
(fset 'append (@ (guile) append))
(fset 'reverse (@ (guile) reverse))
+(fset 'nreverse (@ (guile) reverse!))
(defun car-safe (object)
(if (consp object)
@@ -363,12 +372,79 @@
(defun memq (elt list)
(%member elt list #'eq))
+(defun assoc (key list)
+ (funcall (@ (srfi srfi-1) assoc) key list #'equal))
+
+(defun assq (key list)
+ (funcall (@ (srfi srfi-1) assoc) key list #'eq))
+
+(defun rplaca (cell newcar)
+ (funcall (@ (guile) set-car!) cell newcar)
+ newcar)
+
+(defun rplacd (cell newcdr)
+ (funcall (@ (guile) set-cdr!) cell newcdr)
+ newcdr)
+
+(defun caar (x)
+ (car (car x)))
+
+(defun cadr (x)
+ (car (cdr x)))
+
+(defun cdar (x)
+ (cdr (car x)))
+
+(defun cddr (x)
+ (cdr (cdr x)))
+
+(defmacro dolist (spec &rest body)
+ (apply #'(lambda (var list &optional result)
+ `(mapc #'(lambda (,var)
+ ,@body
+ ,result)
+ ,list))
+ spec))
+
;;; Strings
(defun string (&rest characters)
(funcall (@ (guile) list->string)
(mapcar (@ (guile) integer->char) characters)))
+(defun stringp (object)
+ (funcall (@ (guile) string?) object))
+
+(defun string-equal (s1 s2)
+ (let ((s1 (if (symbolp s1) (symbol-name s1) s1))
+ (s2 (if (symbolp s2) (symbol-name s2) s2)))
+ (funcall (@ (guile) string=?) s1 s2)))
+
+(fset 'string= 'string-equal)
+
+(defun substring (string from &optional to)
+ (apply (@ (guile) substring) string from (if to (list to) nil)))
+
+(defun upcase (obj)
+ (funcall (@ (guile) string-upcase) obj))
+
+(defun downcase (obj)
+ (funcall (@ (guile) string-downcase) obj))
+
+(defun string-match (regexp string &optional start)
+ (let ((m (funcall (@ (ice-9 regex) string-match)
+ regexp
+ string
+ (or start 0))))
+ (if m
+ (funcall (@ (ice-9 regex) match:start) m 0)
+ nil)))
+
+;; Vectors
+
+(defun make-vector (length init)
+ (funcall (@ (guile) make-vector) length init))
+
;;; Sequences
(fset 'length (@ (guile) length))
@@ -376,6 +452,20 @@
(defun mapcar (function sequence)
(funcall (@ (guile) map) function sequence))
+(defun mapc (function sequence)
+ (funcall (@ (guile) for-each) function sequence)
+ sequence)
+
+(defun aref (array idx)
+ (funcall (@ (guile) generalized-vector-ref) array idx))
+
+(defun aset (array idx newelt)
+ (funcall (@ (guile) generalized-vector-set!) array idx newelt)
+ newelt)
+
+(defun concat (&rest sequences)
+ (apply (@ (guile) string-append) sequences))
+
;;; Property lists
(defun %plist-member (plist property test)
@@ -493,3 +583,31 @@
(defun format* (stream string &rest args)
(apply (@ (guile) format) stream string args))
+
+(defun send-string-to-terminal (string)
+ (princ string))
+
+(defun read-from-minibuffer (prompt &rest ignore)
+ (princ prompt)
+ (let ((value (funcall (@ (ice-9 rdelim) read-line))))
+ (if (funcall (@ (guile) eof-object?) value)
+ ""
+ value)))
+
+(defun prin1-to-string (object)
+ (format* nil "~S" object))
+
+;; Random number generation
+
+(defvar %random-state (funcall (@ (guile) copy-random-state)
+ (@ (guile) *random-state*)))
+
+(defun random (&optional limit)
+ (if (eq limit t)
+ (setq %random-state
+ (funcall (@ (guile) random-state-from-platform))))
+ (funcall (@ (guile) random)
+ (if (wholenump limit)
+ limit
+ (@ (guile) most-positive-fixnum))
+ %random-state))
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, master, updated. v2.1.0-185-g52d2472,
BT Templeton <=