Commit 74b5afca authored by Vladimir Sedach's avatar Vladimir Sedach
Browse files

Deprecated WITH special operator.

parent d3f544cd
......@@ -894,7 +894,6 @@ default:
<li>(<code id="let*">LET*</code> ({var | (var value)}*) body)</li>
<li>(<code id="defvar">DEFVAR</code> var {value}?)</li>
<li>(<code id="var">VAR</code> var {value}?)</li>
<li>(<code id="with">WITH</code> object body)</li>
</ul>
<dl>
......@@ -915,9 +914,6 @@ default:
create new global variables, or overwrite the values of already
existing global variables with the same name.</p>
<p>The JavaScript <code>with</code> statement can be generated
using <code>WITH</code>.</p>
<p>Beware that lexical scoping rules in JavaScript differ from
Lisp, and may even be implemented incorrectly in certain browser
JavaScript implementations. This applies particularly to lexical
......
......@@ -100,3 +100,8 @@ is output to the OUTPUT-STREAM stream."
(defun concat-string (&rest things)
(warn-deprecated 'concat-string 'stringify)
(apply #'stringify things))
(define-statement-operator with (expression &rest body)
(warn-deprecated 'with '|LET or WITH-SLOTS|)
`(js:with ,(compile-expression expression)
,(compile-statement `(progn ,@body))))
......@@ -69,6 +69,7 @@
#:labeled-for
#:do-set-timeout
#:concat-string
#:with
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Language
......@@ -170,9 +171,6 @@
#:dolist
#:loop
;; with
#:with
;; case
#:switch
#:case
......
......@@ -603,10 +603,6 @@ Syntax of key spec:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; misc
(define-statement-operator with (expression &rest body) ;; this should be deprecated
`(js:with ,(compile-expression expression)
,(compile-statement `(progn ,@body))))
(define-statement-operator try (form &rest clauses)
(let ((catch (cdr (assoc :catch clauses)))
(finally (cdr (assoc :finally clauses))))
......
......@@ -493,13 +493,6 @@ for (var i in obj) {
default: alert('I always get here');
};")
(test-ps-js the-with-statement-1
(with (create foo "foo" i "i")
(alert (+ "i is now intermediary scoped: " i)))
"with ({ foo : 'foo', i : 'i' }) {
alert('i is now intermediary scoped: ' + i);
};")
(test-ps-js the-try-statement-1
(try (throw "i")
(:catch (error)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment