对于syntax-rules(),The Scheme Programming Language 上面是这样描述的:While it is much less expressive than syntax-case, it is sufficient for defining many common syntactic extension。也就是说,它的表达能力是远弱于 syntax-case 的。syntax-case 在 r6rs 是标准实现所要求的,但是在 r7rs small 中被废除...
Section 1.1. Scheme Syntax Section 1.2. Scheme Naming Conventions Section 1.3. Typographical and Notational Conventions ··· (更多) 原文摘录 ··· During the evaluation of a Scheme expression, the implementation must keep track of two things: (1) what to evaluate and (2) what to do with...
这里的例子来自 the scheme Programming Language,使用 syntax-case 宏定义了一个循环结构: (define-syntax loop (lambda (x) (syntax-case x () [(k e ...) (with-syntax ([break (datum->syntax #'k 'break)]) #'(call/cc (lambda (break) (let f () e ... (f)))]))) 当然,上面的代码...
Generics without all that syntax 泛型编程不需要关心很多语法,比如类型在 java, c, c++ 中等等。 Generating code is easy 相对其他编程语言生成代码相对简单很多 Metaprogramming is just ... programming 元编程在 Scheme 中与正常编程无异 Macros are (almost) just more code 宏是一种元编程,在 Scheme 中只...
SyntaxModelsComputer programmingThe paper discusses how to classify declarative programming languages, includingfunctional logic ones, on the basis of declarative semantics. Four base paradigms are identified. Each stands for an uncombined language approach, such as Horn logic programming. Other declarative ...
短语“语法违规(syntax violation)”用于描述程序格式不正确的情况。在程序执行之前可以检测到语法违规。当检测到语法违规时,将引发类型和语法的异常,程序将不执行。 本书中使用的排版惯例很简单。所有Scheme对象都使用打字机字体打印,就像在键盘上键入一样。这包括语法关键字、变量、常量对象、Scheme表达式和示例程序。斜...
Delayed evaluation allows the implementation of asynchronous programming techniques such as promises and futures. Hygenic macros— a macro system that allows the programmer to extend the functionality of the language without interfering with the language's native syntax. The ability to natively evaluate ...
calls itself in the "tail" position is just a loop Significant Language Features Scheme has several important advantages It is elegantly simple in that regular structure and trivial syntax avoids "special case" confusion Its expressiveness means that one spends little time trying to work around the...
摘要: Java (programming language). Java (software platform), Java Virtual Machine, Java performance, Java syntax, Java applet, JavaServer Pages, Swing (Java), Java Servlet, Generics in Java, Javadoc, Criticism of Java关键词: Java (Programmiersprache ...
(syntax-rules () ((_ exp) (cons exp '())) ((_ exp1 exp2 ...) (cons exp1 (ourlst exp2 ...))) (display (ourlst 1 2 3 4 5)) (newline) 上面代码的结果如下: 15 (1 2 3 4 5) 在sum宏定义中,如果附合规则(_ exp1 exp2 ...)或(sum exp1 exp2 ...)将按(+ exp1 ex...