English 中文(简体)
定义与定义之间的差别*
原标题:Difference between define and define*

原谅我的无知 但两者有什么区别

(define blah)
(define* blah)

不幸的是,谷歌忽略了星号字符。

最佳回答

SRFI 89 是Gambits作者写的,所以假设Gambits define/code>做该文件所说的事情是有道理的。 :-)

换句话说,它是在lambda/code>(如SRFI 89所述)而不是lambda 上的合成糖。

问题回答

在《甘比特计划》的文件 < a href=" http://www.iro. umontreal.ca/~gambit/doc/gambit-c.html" rel=“no follow” > Documentation 中,没有提及 "define\\\/code > 特殊形式;它可能是某种程序、定义、宏观或特殊形式,只有在你看到的代码中找到。您应该张贴一个链接,引用代码的来源,其中正在使用 define/code>。

这个问题最好多说点背景情况。

Sometimes the * just means that the form does something extra. My guess is therefore that define* works as ordinary define, but at the same time does something extra. This extra could be automatically exporting the name from a module.

This definition was found in the Racket ffi-lib illustrates this principle:

(define-syntax define*
  (syntax-rules ()
    [(_ (name . args) body ...)
     (begin (provide name) (define (name . args) body ...))]
    [(_ name expr)
     (begin (provide name) (define name expr))]))




相关问题
Parsing with DCGs in Scheme (without Prolog)?

Lots of Prolog-in-Scheme implementations are out there. E.g. Kanren, Schelog. Apparently in "Paradigms of AI Programming" Norvig implements Prolog-to-Lisp compiler in Lisp in order to use Definite ...

Applying a symbol as a procedure

Suppose I have a simple symbol: > + + Is there any way I can apply that symbol as a procedure: > ((do-something-with +) 1 2) 3 So that + is evaluated to the procedure +?

string-split in DrScheme

How do I do equivalent of python s str.split in DrScheme? SRFI-13 doesn t seem to have it provided.

Scheme, getting the pointer from pointed struct

Assume I have a such struct: (define-struct node (value next)) ;and making 2 nodes, parent pointing to child as next. (define child (make-node 2 null)) (define parent (make-node 1 child)) Under ...

How to solve the following equation using accumulate (Scheme)

I m trying to do the following problem (there is a formula so I print-screened and uploaded it) Formula http://img248.imageshack.us/img248/6558/problemh.jpg (http://img248.imageshack.us/img248/6558/...