Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

REPLコマンド: calcコマンド追加

  • Loading branch information...
commit 2cd4bec0c7559754a76a840e477c90904182571f 1 parent 01d727a
@youz authored
Showing with 12 additions and 0 deletions.
  1. +1 −0  site-lisp/xl-repl/command.l
  2. +11 −0 site-lisp/xl-repl/command/calc.l
View
1  site-lisp/xl-repl/command.l
@@ -5,5 +5,6 @@
(require "xl-repl/command/path")
(require "xl-repl/command/help")
(require "xl-repl/command/step")
+(require "xl-repl/command/calc")
(provide "xl-repl/command")
View
11 site-lisp/xl-repl/command/calc.l
@@ -0,0 +1,11 @@
+;;; -*- mode:lisp; package:repl -*-
+(provide "xl-repl/command/calc")
+
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (require "xl-repl/repl-mode"))
+
+(in-package :repl)
+
+(defun repl.command::calc (&rest exprs)
+ (let ((result (ed::calc-string (format nil "~{~A~^ ~}" exprs))))
+ (eval-and-print (format nil "~A" result) t)))
Please sign in to comment.
Something went wrong with that request. Please try again.