r7rs

Difference between load and include in Scheme R7RS

点点圈 提交于 2020-07-08 21:16:16
问题 In Scheme R7RS there is both a load and include form. Include is described as: Semantics: Both include and include-ci take one or more filenames expressed as string literals, apply an implementation-specific algorithm to find corresponding files, read the contents of the files in the specified order as if by repeated applications of read, and effectively re- place the include or include-ci expression with a begin expression containing what was read from the files. The difference between the

Difference between load and include in Scheme R7RS

心已入冬 提交于 2020-07-08 21:07:11
问题 In Scheme R7RS there is both a load and include form. Include is described as: Semantics: Both include and include-ci take one or more filenames expressed as string literals, apply an implementation-specific algorithm to find corresponding files, read the contents of the files in the specified order as if by repeated applications of read, and effectively re- place the include or include-ci expression with a begin expression containing what was read from the files. The difference between the

Is it possible to “extend” a function / lambda / macro in Scheme?

最后都变了- 提交于 2019-12-22 07:12:08
问题 For example: if I want the function equal? recognize my own type or record, can I add a new behavior of equal? ? without erasing or overwriting the old one? Or for example if I want to make the function "+" accept also string? 回答1: Rather than using import , a better solution is to keep track of the original function by let -binding it. It's also better to check that the type of the argument is a string, rather than that it is not a number. Using both of these approaches means that it's

Is it possible to “extend” a function / lambda / macro in Scheme?

本秂侑毒 提交于 2019-12-22 07:10:02
问题 For example: if I want the function equal? recognize my own type or record, can I add a new behavior of equal? ? without erasing or overwriting the old one? Or for example if I want to make the function "+" accept also string? 回答1: Rather than using import , a better solution is to keep track of the original function by let -binding it. It's also better to check that the type of the argument is a string, rather than that it is not a number. Using both of these approaches means that it's

Is it possible to “extend” a function / lambda / macro in Scheme?

风格不统一 提交于 2019-12-05 11:34:11
For example: if I want the function equal? recognize my own type or record, can I add a new behavior of equal? ? without erasing or overwriting the old one? Or for example if I want to make the function "+" accept also string? Rather than using import , a better solution is to keep track of the original function by let -binding it. It's also better to check that the type of the argument is a string, rather than that it is not a number. Using both of these approaches means that it's possible to compose the technique. (define + (let ((old+ +)) (lambda args (if (string? (car args)) (apply string