178 |
(defun cl-set-substring (str start end val) |
(defun cl-set-substring (str start end val) |
179 |
(if end (if (< end 0) (incf end (length str))) |
(if end (if (< end 0) (incf end (length str))) |
180 |
(setq end (length str))) |
(setq end (length str))) |
181 |
(if (< start 0) (incf start str)) |
(if (< start 0) (incf start (length str))) |
182 |
(concat (and (> start 0) (substring str 0 start)) |
(concat (and (> start 0) (substring str 0 start)) |
183 |
val |
val |
184 |
(and (< end (length str)) (substring str end)))) |
(and (< end (length str)) (substring str end)))) |
207 |
"Return multiple values, Common Lisp style. |
"Return multiple values, Common Lisp style. |
208 |
The arguments of `values' are the values |
The arguments of `values' are the values |
209 |
that the containing function should return." |
that the containing function should return." |
210 |
(apply 'list values)) |
values) |
211 |
|
|
212 |
(defsubst values-list (list) |
(defsubst values-list (list) |
213 |
"Return multiple values, Common Lisp style, taken from a list. |
"Return multiple values, Common Lisp style, taken from a list. |
229 |
one value." |
one value." |
230 |
(apply function expression)) |
(apply function expression)) |
231 |
|
|
232 |
|
(defalias 'multiple-value-call 'apply |
233 |
|
"Apply FUNCTION to ARGUMENTS, taking multiple values into account. |
234 |
|
This implementation only handles the case where there is only one argument.") |
235 |
|
|
236 |
(defsubst nth-value (n expression) |
(defsubst nth-value (n expression) |
237 |
"Evaluate EXPRESSION to get multiple values and return the Nth one. |
"Evaluate EXPRESSION to get multiple values and return the Nth one. |
238 |
This handles multiple values in Common Lisp style, but it does not work |
This handles multiple values in Common Lisp style, but it does not work |
678 |
(defun cl-hack-byte-compiler () |
(defun cl-hack-byte-compiler () |
679 |
(if (and (not cl-hacked-flag) (fboundp 'byte-compile-file-form)) |
(if (and (not cl-hacked-flag) (fboundp 'byte-compile-file-form)) |
680 |
(progn |
(progn |
681 |
(cl-compile-time-init) ; in cl-macs.el |
(setq cl-hacked-flag t) ; Do it first, to prevent recursion. |
682 |
(setq cl-hacked-flag t)))) |
(cl-compile-time-init)))) ; In cl-macs.el. |
683 |
|
|
684 |
;;; Try it now in case the compiler has already been loaded. |
;;; Try it now in case the compiler has already been loaded. |
685 |
(cl-hack-byte-compiler) |
(cl-hack-byte-compiler) |