scheme代码高亮
(defun iedit-symbol-in-defun ()
"Enter `iedit-mode' to rename the symbol in current function, or exit it."
(interactive)
(if iedit-mode
(progn
(iedit-mode -1)
(widen))
(progn
(if (thing-at-point 'symbol)
(progn
(narrow-to-defun)
(iedit-mode t)
(message "When done, run `epy-iedit-in-defun' again to quit.")
)
(error "You need to put cursor on identifier.")
))))
(define-struct parent (childs name date eyes)) ;;youngest
(define Gustav (make-parent empty 'Gustav 1988 'blue)) (define Fred*Eva (list Gustav)) ;;younger
(define Adam (make-parent empty 'Adam 1950 'yellow))
(define Dave (make-parent empty 'Dav 1955 'black))
(define Eva (make-parent Fred-Eva 'Eva 1965 'blue))
(define Fred (make-parent Fred-Eva 'Fred 1966 'pink)) (define Carl*Bettina (list Adam Dave Eva)) ;;older
(define Carl(make-parent Carl*Bettina 'Carl 1926 'green))
(define Bettina(make-parent Carl*Bettina 'Bettina 1926 'green)) ;是否有后代是蓝眼睛
(define (blue-eyed-descendant? a-parent)
(cond
[(symbol=? (parent-eyes a-parent) 'blue) true]
[else (blue-eyed-children? (parent-childs a-parent))])) (define (blue-eyed-children? list-of-childs)
(cond
[(empty? list-of-childs) false]
[(symbol=? (parent-eyes (first list-of-childs)) 'blue) true]
[else (blue-eyed-children?(rest list-of-childs))])) ;;搜索后代中谁是蓝睛眼
;;blue-eyed-desendant-who? a-parent->symbol
(define (blue-eyed-desendant-who? a-parent)
(append
(cond
[(symbol=? (parent-eyes a-parent) 'blue) (list (parent-name a-parent))]
[else empty]) ;先搜索自己,蓝眼睛为真,返回自己,否则返回empty
(blue-eyed-children-who? (parent-childs a-parent))));再继续搜索子代 ;相并集append ;;搜索子代中谁是蓝眼睛
(define (blue-eyed-children-who? list-of-childs)
(cond
[(empty? list-of-childs) empty] ;如果子代是空集为真,则返回empty,递归结束
[else (append (list (blue-eyed-desendant-who? (first list-of-childs))) (blue-eyed-children-who? (rest list-of-childs)))]))
;反之有子代,则搜索第一个的蓝眼睛后代和剩余的蓝眼睛子代(包含求第一个的蓝眼晴后代和剩余的蓝眼睛子代(...)) (define (appendx lst)
(cond
[(empty? lst) empty]
[(empty? (first lst)) (appendx (rest lst))]
[else (append (first lst) (appendx (rest lst)))]) ) (define (atom? x)
(not (or (cons? x) (null? x)))) (define lst-out empty) (define (fun lst)
(cond
[(empty? lst) empty]
[(atom? (first lst))
(cond
[(atom? (rest lst)) ]
(append (list (first lst)) lst-out)]
[else (append (fun (first lst)) (fun (rest lst)))]))
# include <iostream> int main()
{
std::cout << "Hello, world!" << std::endl; return 0;
} int main()
{
std::cout << "Hello, world!" << std::endl; return 0;
} int main()
{
std::cout << "Hello, world!" << std::endl; return 0;
} int main()
{
std::cout << "Hello, world!" << std::endl; return 0;
} int main()
{
std::cout << "Hello, world!" << std::endl; return 0;
}
# include <iostream> int main()
{
std::cout << "Hello, world!" << std::endl; return ;
}
(format t "Hello world")
函数定义:
(defun hello-world ()
(format t ("hello, world!"))
调用函数:
(hello-world)
;;"hello,world!"
scheme代码高亮的更多相关文章
- 新语言代码高亮及Windows Live Writer插件开发
最近在博客园做一些学习笔记.一个是看apple的swift官方书,另外一个是随学校课堂(SICP)学习scheme. 这两种语言都谈不上普及(或者说swift太新).博客园原来的windows liv ...
- 如何使用SublimeText风格的代码高亮样式 添加Zed Coding(EMMET)插件
因为觉得博客园自带的代码高亮样式很单一,不符合作为前端的我的审美习惯,于是下定决心要想办法折腾出一个方法来应用上另外一套代码高亮样式. 虽然探索的过程是很痛苦的,但最后还是成功了,但也不枉付出的那些努 ...
- 使用prismjs为网站添加代码高亮功能
prismjs 是一款轻量.可扩展的代码语法高亮库,使用现代化的 Web 标准构建,使用 Prismjs 可以快速为网站添加代码高亮功能,支持超过113中编程语言,还支持多种插件,是简洁.高效的代码高 ...
- 五、Google Code Prettify:实现代码高亮的JS库
介绍 code prettify 解释为 “代码修饰”. 他由JS代码和CSS代码构成,用来高亮显示HTML页面中的代码. 支持:C, Java, Python, Bash, HTML, XML, J ...
- Mac 配置代码高亮 Git状态显示
Mac 一个为开发者量身定做的笔记本,分享给大家希望能帮助大家配置一个好的开发环境,好的开发环境才有好的心情Code. 首先进入到Home到目录一般默认打开的都是Home,如果不是输入 cd ~ 回车 ...
- 如何在Open Live Writer(OLW)中使用precode代码高亮Syntax Highlighter
早先Microsotf的Windows Live Writer(WLW)现在已经开源了,并且更名为Open Live Writer,但是现在Windows Live Writer还是可以现在,Open ...
- 如何在博客中使用SublimeText风格的代码高亮样式
因为觉得博客园自带的代码高亮样式很单一,不符合作为前端的我的审美习惯,于是下定决心要想办法折腾出一个方法来应用上另外一套代码高亮样式. 虽然探索的过程是很痛苦的,但最后还是成功了,但也不枉付出的那些努 ...
- highlight.js 代码高亮插件
官网:https://highlightjs.org/ API:http://highlightjs.readthedocs.org/en/latest/api.html 1. 简单使用: <l ...
- 7个高性能JavaScript代码高亮插件
本文由码农网 – 小峰原创,转载请看清文末的转载要求,欢迎参与我们的付费投稿计划! 对于喜欢写技术博客的同学来说,一定对代码高亮组件非常熟悉.一款优秀的JavaScript代码高亮插件,将会帮助你渲染 ...
随机推荐
- The Contiki build system 编译系统
The Contiki build system======================== The Contiki build system is designed to make it eas ...
- android 登录界面
http://blog.csdn.net/jiabinjlu/article/details/6920967 http://blog.csdn.net/myserverthepeople/articl ...
- JMXMP SSL
http://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html http://docs.oracle.com/c ...
- elasticsearh 中每个节点中需要有相同的插件
elasticsearh 中每个节点中需要有相同的插件 [2016-09-13 19:25:24,049][INFO ][discovery.zen ] [node02] failed to send ...
- C5-信号量与PV操作(iOS篇-细说信号量)
一.概述 信号量这种同步机制的概念. P, V操作(Dijkstra提出)的定义 github地址(iOS中的信号量是以1开始定义): https://github.com/sixleaves/sem ...
- The 4th tip of DB Query Analyzer
The 4th tip of DB QueryAnalyzer Ma Genfeng (Guangdong Unitoll Services incorporated, Guangzhou 51030 ...
- 自己写jstl标签解析long时间
数据库里存储的是long型的时间,现在想输出到jsp页面,由于使用的是jstl标签,而要显示的是可读的时间类型,找来找去有个fmt:formatDate可以转化,但是只能转date型,long型则不可 ...
- xib和Storyboard 创建Cell的方式
xib 方式 .在Cell.h文件中加一个宏 #define cellIdentifier @"customCell" . ViewController中: - (void)vie ...
- 数据库中简单的增删改查(CRUD)
一切都是基于数据,而对数据的管理都离不开数据库.最近学到数据库的简单操作,所以写下这篇文章,总结一下学习到的知识.浅陋之处,多多见谅. 补充一下:一直弄不清SQL Server,Mysql ,以及Or ...
- (2)入门指南——(3)为什么jquery工作的很好(Why jQuery works well)
With the resurgence of interest in dynamic HTML comes a proliferation of JavaScript frameworks. Some ...