![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
scheme
芦笛
这个作者很懒,什么都没留下…
展开
-
Chez Scheme for windows
common lisp 太庞大了,从好几遍的编译就看得出来。scheme没历史包袱, 简单许多, 目前公认最好的是Chez Scheme。git 源码编译,linux上没有什么问题,windows上要用vc++才能编译。 如果不想动手下载好几个GB的vs iso, windows 编译版本请从下面下载:https://github.com/DeYangLiu/ChezSch原创 2017-06-07 20:48:03 · 3728 阅读 · 0 评论 -
lisp 代码计算月供
;; 等额本息还款debx, 输入总金额A, 年利率y, m个月还清, 计算月供和总利息:;; 例子: (debx 1000000 0.0631 (* 30 12)) ;==>;; 6196.247877564253;; 1230649.235923131(define (debx A y m) (let* [(b (/ y 12)) (b1 (expt (+ 1 b) ...原创 2018-03-25 14:26:42 · 569 阅读 · 0 评论 -
chez scheme for android 移植完成
到今天终于把喜欢的lisp移植到android上,前后花了不少晚上时间。android版本由scheme 命令行可执行程序, 解释器运行时petite.boot, 编译器组件scheme.boot三个文件组成。另外还开发了一个跟chez scheme官方源码无关的加载器:run-native-exe apk: 调用scheme, IO重定向到UI。运行示例:上面的截屏有几个技术点,这里总结下: ...原创 2018-03-18 23:20:04 · 1829 阅读 · 1 评论 -
C++ namespace和scheme library 对比
#include int a = 1;namespace A { int a = 2; namespace B { int a = 3; int fun() { printf("%d %d %d\n", a, A::a, ::a); //3 2 1 } }}int main() { A::B::fun(); using namespace A; //引入A::原创 2018-02-04 23:02:01 · 372 阅读 · 0 评论 -
数学集合的lisp表示
数学上集合的表示:有理数集 和正实数集 则可以分别表示为 和 lisp 表示:(set-of x (x in '(1 2 3))) ;==> (1 2 3)(set-of (cons x y) (x in '(1 2 3)) (y is (* x x))) ;==> ((1 . 1) (2 . 4) (3 . 9原创 2018-01-28 21:34:31 · 333 阅读 · 0 评论 -
用lisp语言操作sqlite3数据库
linux环境下,先下载[1]对sqlite3.so的封装库代码。接口文档参考[2], 例子来自[3]。> (load "sqlite3.sls") ;加载库代码> (import (sqlite3)) ;引入名字空间> (define db (open-database "yy.db")) ;创建或打开数据库> (define stmt (prepare db "CREATE T原创 2018-02-01 22:44:12 · 1001 阅读 · 0 评论 -
离散傅里叶变换DFT的推导和lisp实现
lisp 代码:点击打开链接执行例子:> (load "ss/dft.ss")> (dft '(1 1 1 1 1 1 1 1))(8 0 0 0 0 0 0 0)> (idft (dft '(1 1 1 1 1 1 1 1)))(1 1.0 1.0 1.0 1 1.0 1.0 1.0)> (dft '(1 2 3 4 5 6 7 8))(36 -4.0+9.6原创 2018-01-31 23:08:34 · 558 阅读 · 0 评论 -
在windows上编译chez scheme代码生成独立可执行文件
依赖:mingw工具链gcc, 预制文件 [1]。测试文件test.ss内容为:(import (chezscheme))(printf "args is ~a~%"(command-line-arguments))编译:$ ./compile-chez-program.exe test.ss执行: $ ./test 123 456args is (1原创 2018-01-24 12:51:01 · 2983 阅读 · 0 评论 -
continuation 及阴阳谜题的详细解释
call-with-current-continuation: obtains its continuation and passes it to procedure. The continuation itself is represented by a procedure. Each time this procedure is applied to zero or more values,原创 2018-01-15 22:37:41 · 379 阅读 · 0 评论 -
chez scheme的交叉编译
download upstream sourcegit clone –depth 1 https://github.com/cisco/ChezSchemebuild mingw target on win7 hostpatchmerge the contents of patch-for-mingw directory.build hostmsys> ./configure -m=ti3nt原创 2017-12-13 20:17:56 · 1289 阅读 · 0 评论 -
计算机生成的简单英文句子
> (define (sentence) (append (noun-phrase) (verb-phrase)))> (define (noun-phrase) (append (Article) (Noun)))> (define (verb-phrase) (append (Verb) (noun-phrase)))> (define (Article) (on...原创 2018-03-27 22:25:09 · 1126 阅读 · 0 评论