(and (symbolp x) (eq (binding-type (lookup-function x *fenv*)) 'macro)))
(defun ls-macroexpand-1 (form env fenv)
- (when (macrop (car form))
- (let ((binding (lookup-function (car form) *env*)))
- (if (eq (binding-type binding) 'macro)
- (apply (eval (binding-translation binding)) (cdr form))
- form))))
+ (if (macrop (car form))
+ (let ((binding (lookup-function (car form) *env*)))
+ (if (eq (binding-type binding) 'macro)
+ (apply (eval (binding-translation binding)) (cdr form))
+ form))
+ form))
(defun compile-funcall (function args env fenv)
(cond
<!doctype html>
<html>
+ <head>
+ <style>
+ /* The console container element */
+ body { background-color: black; font-size: 16px; font-family: Courier; }
+
+ #console {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ background-color:black;
+ }
+ /* The inner console element. */
+ .jqconsole {
+ padding: 10px;
+ }
+ /* The cursor. */
+ .jqconsole-cursor {
+ background-color: gray;
+ }
+ /* The cursor color when the console looses focus. */
+ .jqconsole-blurred .jqconsole-cursor {
+ background-color: #666;
+ }
+ /* The current prompt text color */
+ .jqconsole-prompt {
+ color: White;
+ }
+ /* The command history */
+ .jqconsole-old-prompt {
+ color: White;
+ font-weight: normal;
+ }
+ /* The text color when in input mode. */
+ .jqconsole-input {
+ color: White;
+ }
+ /* Previously entered input. */
+ .jqconsole-old-input {
+ color: White;
+ font-weight: normal;
+ }
+ /* The text color of the output. */
+ .jqconsole-output {
+ color: gray;
+ }
+ </style>
+ </head>
+
<body>
- <script type="text/javascript" src="test.js"></script>
+ <div id="console"></div>
+ <script src="test.js" type="text/javascript"></script>
+ <script src="jquery.js" type="text/javascript" charset="utf-8"></script>
+ <script src="jqconsole.min.js" type="text/javascript" charset="utf-8"></script>
+ <script>
+ $(function () {
+ var jqconsole = $('#console').jqconsole('Hi\n', '> ');
+ var startPrompt = function () {
+ // Start the prompt with history enabled.
+ jqconsole.Prompt(true, function (input) {
+ // Output input with the class jqconsole-output.
+ if (input[0] == ',')
+ jqconsole.Write(JSON.stringify(lisp.evalString(input)) + '\n', 'jqconsole-output');
+ jqconsole.Write(JSON.stringify(lisp.compileString(input)) + '\n', 'jqconsole-output');
+ // Restart the prompt.
+ startPrompt();
+ });
+ };
+ startPrompt();
+ });
+ </script>
</body>
</html>
(and (symbolp x) (eq (binding-type (lookup-function x *fenv*)) 'macro)))
(defun ls-macroexpand-1 (form env fenv)
- (when (macrop (car form))
- (let ((binding (lookup-function (car form) *env*)))
- (if (eq (binding-type binding) 'macro)
- (apply (eval (binding-translation binding)) (cdr form))
- form))))
+ (if (macrop (car form))
+ (let ((binding (lookup-function (car form) *env*)))
+ (if (eq (binding-type binding) 'macro)
+ (apply (eval (binding-translation binding)) (cdr form))
+ form))
+ form))
(defun compile-funcall (function args env fenv)
(cond