如何配置apache + mod_lisp + clisp并设置"Hello World!"?我找不到关于这个主题的任何完整的指南.谢谢.
编辑:Vebjorn的解决方案有效,但后来我不知道如何编写"你好世界!".谁能告诉我怎么办?有一些东西,比如刷新clisp,然后用SLIME连接到它,但是当我启动mod_lisp的演示时,测试页面没有提供,我的粘液不会返回?
再次感谢.
我正在使用cmd模块对Python应用程序进行原型设计.
给用户的一些消息会很长,我想对它们进行分页.将显示消息的前10行(或可配置的数字)行,按空格键将显示下一页,直到消息结束.
我不想在这里重新发明一些东西,有一个简单的意思来实现这个功能吗?
我在Instaparse(Clojure)中编写了一个使用无上下文语法解析字符串的项目.现在我想测试几个输入字符串的解析结果.某些输入字符串可能不适合语法.到目前为止,我只测试了"解析后的字符串不符合预期".但我认为使用测试异常会更准确(is (thrown? ...)).是否抛出异常?在我看来,Parse error...生成了一些输出(Containing ),但没有抛出任何异常.
我的project.clj是:
(defproject com.stackoverflow.clojure/tests "0.1.0-SNAPSHOT"
:description "Tests of Clojure test-framework."
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[instaparse "1.3.4"]])
Run Code Online (Sandbox Code Playgroud)
我的核心资源是:
(ns com.stackoverflow.clojure.testInstaparseWrongGrammar
(:require [instaparse.core :as insta]))
(def parser (insta/parser "
<sentence> = words <DOT>
DOT = '.'
<words> = word (<SPACE> word)*
SPACE = ' '
word = #'(?U)\\w+'
"))
(defn formatter [expr]
(->> (parser expr)
(insta/transform {:word identity})
(apply str)))
Run Code Online (Sandbox Code Playgroud)
我的测试来源是:
(ns com.stackoverflow.clojure.testInstaparseWrongGrammar-test
(:require [clojure.test :refer …Run Code Online (Sandbox Code Playgroud) 假设我在工作中实现了一些个人计算的功能。我想构建一个.jar我的同事也会在 REPL 中使用的 (uberjar),例如:
megacorpcalcs.core=> (+ 2 2)
4
megacorpcalcs.core=> (salary 8 0.4)
666$
Run Code Online (Sandbox Code Playgroud)
我应该输入什么代码才能在.jar启动时启动 REPL?
我正在为必须检查父方法的方法编写装饰器(在我正在装饰的类的父级中使用相同名称的方法).
示例(来自PEP 318的第四个示例):
def returns(rtype):
def check_returns(f):
def new_f(*args, **kwds):
result = f(*args, **kwds)
assert isinstance(result, rtype), \
"return value %r does not match %s" % (result,rtype)
return result
new_f.func_name = f.func_name
# here I want to reach the class owning the decorated method f,
# it should give me the class A
return new_f
return check_returns
class A(object):
@returns(int)
def compute(self, value):
return value * 3
Run Code Online (Sandbox Code Playgroud)
所以我正在寻找代码#代替我想要的代码......
谢谢.
我正在使用reveal.js来显示屏幕截图,但图片不会以100%的大小显示.
我敢打赌,有一个"缩放"技巧,正如检查员所示:
<div class="slides" style="-snip- zoom: 0.5001428571428572;">
Run Code Online (Sandbox Code Playgroud)
但我无法阻止它发生.是否有配置选项,js hack为此?
这是一张我想要800×600图像显示800×600的幻灯片:http: //profgra.org/lycee/presentation_demo.html#/2
谢谢!
对于测试驱动的教学模块,我需要按照精确的顺序检查doctests.有没有办法按照它们的定义顺序获取当前模块中的所有可调用对象?
我尝试了什么:
对于我正在实现的DSL,我想创建一个=/函数(就像not=).
有可能告诉读者允许我这样做吗?
我的猜测是"不,你做梦.",但是谁知道......
user=> =/
RuntimeException Invalid token: =/ clojure.lang.Util.runtimeException (Util.java:221)
user=> (def =/ 1)
RuntimeException Invalid token: =/ clojure.lang.Util.runtimeException (Util.java:221)
1
RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221)
user=> (defn =/ [x y] (not= x y))
RuntimeException Invalid token: =/ clojure.lang.Util.runtimeException (Util.java:221)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: y in this context, compiling:(NO_SOURCE_PATH:0:0)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: y in this context, compiling:(NO_SOURCE_PATH:16:16)
RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221)
Run Code Online (Sandbox Code Playgroud) 有人会给我提示(或整个解决方案!)这个问题:
在Clojurescript项目中,如何在使用应用程序时自动对符号中的编译日期/时间进行硬编码以显示它?
谢谢.
对于嵌入式DSL,我想删除所有核心功能,并逐个需要我需要的功能.有可能吗?怎么样?
clojure ×4
python ×3
apache ×1
clisp ×1
cmd ×1
compilation ×1
decorator ×1
doctest ×1
exception ×1
instaparse ×1
javascript ×1
lisp ×1
pagination ×1
parsing ×1
reveal.js ×1