Coder Social home page Coder Social logo

tinyscheme_note's Introduction

tinyscheme注释

作者:flysnowxg
email:[email protected]
tinyscheme是一个scheme语言的解释器实现,而这是我大幅修改并加了注释后的tinyscheme(基于tinyscheme1.41)
原始代码: http://tinyscheme.sourceforge.net/home.html
tinyscheme据说是实现的r5rs标准(应当是实现了一部分,因为模式匹配和语法定义的那部分显然没实现)
tinyscheme代码很简短而且实现的语言功能还算比较完整,如果想研究一个lisp解释器的实现,tinyscheme是值得研究的
tinyscheme实现了lambda、宏、延续、异常、gc这些重要的语言机制,还实现了许多库函数,整个原版代码大约有6500行左右,但是原版代码有很多的宏定义和很多冗余的代码,代码分类也很混乱,可读性不算特别好,在阅读过程中我对这个代码进行了大量的修改,清除了大量冗余代码,重新组织了代码结构,主要的实现文件scheme.c被我从5000行改到只有3400行。所有代码加起来也只有4500行了,功能损失也很小
并修改一些bug,比如像‘延续’的实现,原版像下面这样的代码中, “(r 1)”这一句是没法运行的
(define r 0)
(let ((x 1))
(set! x
(+ x
(call/cc (lambda (c) (set! r c) (+ 44 (c 1)))))
)
(display x))
(r 1)

tinyscheme_note's People

Contributors

flysnowxg avatar

Stargazers

Levinn avatar Zack avatar  avatar wmingjian avatar

Watchers

James Cloos avatar  avatar

Forkers

lzcers hack-yao hyj0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.