(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代码高亮的更多相关文章

  1. 新语言代码高亮及Windows Live Writer插件开发

    最近在博客园做一些学习笔记.一个是看apple的swift官方书,另外一个是随学校课堂(SICP)学习scheme. 这两种语言都谈不上普及(或者说swift太新).博客园原来的windows liv ...

  2. 如何使用SublimeText风格的代码高亮样式 添加Zed Coding(EMMET)插件

    因为觉得博客园自带的代码高亮样式很单一,不符合作为前端的我的审美习惯,于是下定决心要想办法折腾出一个方法来应用上另外一套代码高亮样式. 虽然探索的过程是很痛苦的,但最后还是成功了,但也不枉付出的那些努 ...

  3. 使用prismjs为网站添加代码高亮功能

    prismjs 是一款轻量.可扩展的代码语法高亮库,使用现代化的 Web 标准构建,使用 Prismjs 可以快速为网站添加代码高亮功能,支持超过113中编程语言,还支持多种插件,是简洁.高效的代码高 ...

  4. 五、Google Code Prettify:实现代码高亮的JS库

    介绍 code prettify 解释为 “代码修饰”. 他由JS代码和CSS代码构成,用来高亮显示HTML页面中的代码. 支持:C, Java, Python, Bash, HTML, XML, J ...

  5. Mac 配置代码高亮 Git状态显示

    Mac 一个为开发者量身定做的笔记本,分享给大家希望能帮助大家配置一个好的开发环境,好的开发环境才有好的心情Code. 首先进入到Home到目录一般默认打开的都是Home,如果不是输入 cd ~ 回车 ...

  6. 如何在Open Live Writer(OLW)中使用precode代码高亮Syntax Highlighter

    早先Microsotf的Windows Live Writer(WLW)现在已经开源了,并且更名为Open Live Writer,但是现在Windows Live Writer还是可以现在,Open ...

  7. 如何在博客中使用SublimeText风格的代码高亮样式

    因为觉得博客园自带的代码高亮样式很单一,不符合作为前端的我的审美习惯,于是下定决心要想办法折腾出一个方法来应用上另外一套代码高亮样式. 虽然探索的过程是很痛苦的,但最后还是成功了,但也不枉付出的那些努 ...

  8. highlight.js 代码高亮插件

    官网:https://highlightjs.org/ API:http://highlightjs.readthedocs.org/en/latest/api.html 1. 简单使用: <l ...

  9. 7个高性能JavaScript代码高亮插件

    本文由码农网 – 小峰原创,转载请看清文末的转载要求,欢迎参与我们的付费投稿计划! 对于喜欢写技术博客的同学来说,一定对代码高亮组件非常熟悉.一款优秀的JavaScript代码高亮插件,将会帮助你渲染 ...

随机推荐

  1. iOS数据持久化 -- Core Data-备用

    Core Data是一个功能强大的层,位于SQLite数据库之上,它避免了SQL的复杂性,能让我们以更自然的方式与数据库进行交互.Core Data将数据库行转换为OC对象(托管对象)来实现,这样无需 ...

  2. My Eclipse 自动提示

    1.My Eclipse 自带代码提示快捷键 “ alt+/”. 2.输入即提示:window-->preferences-->java-->Editor 展开后点击Content ...

  3. Linux下装VirtualBox

    一:下载 进入VirtualBox的下载地址:https://www.virtualbox.org/ 点击左侧的download, 选择适合自己系统的版本,我的是红帽,故选择: 进行下载. 二:安装 ...

  4. mysql 导出导入sql

    >mysqldump -u用户名 -p密码 -h主机名 数据库名 > 20150116mw_pm_db.sql mysql> source /home/y/my_work/20150 ...

  5. Flash型单片机的加密与解密

    厂商利用单片机进行产品开发时,都会关心其代码和数据的保密性.考虑到用户在编写和调试代码时所付出的时间和精力,代码的成本是不言而喻的.    早期的单片机,代码是交给芯片制造商制成掩膜ROM.有两种加密 ...

  6. ListView中添加ScrollView只显示一两行的问题

    将ListView改为继承NoScrollListView package com.example.brtz.widget; import android.content.Context; impor ...

  7. QT5.1.0,QT4.8.0以及VC2010、VC2012的测试对比

    QT5.1.0,QT4.8.0以及VC2010.VC2012的交叉测试对比. 测试1: 用VC2012静态编译了QT5.1.0. 编译速度很慢,生成完成后,用VC2012+QT5.1.0进行程序生成, ...

  8. (\S)? 匹配0个或者一个前导字符

    ---------------------------------------------- "1" 模式: \"(?<id>(\S+)?)\" ? ...

  9. poj 3684 Physics Experiment(数学,物理)

    Description Simon ), the first ball is released and falls down due to the gravity. After that, the b ...

  10. hdu 1429 胜利大逃亡(续)(bfs+状态压缩)

    Problem Description Ignatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)…… 这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带 ...