scheme

How do you load a file into racket via command line?

巧了我就是萌 提交于 2019-12-03 05:42:38
I have been trying to launch a racket program from the commandline (via 'racket') but have not been having success. According to the documentation (here http://docs.racket-lang.org/reference/running-sa.html#%28part._mz-cmdline%29 ) passing -f followed by a file should evaluate that file. However, I can't seem to get this to work. As a test, I made the following file: ;test.rkt #lang racket (define a 1) Then, running it in racket (supposedly loading the file) and attempting to recall the value of a: racket -f test.rkt -i Welcome to Racket v5.1.1. > a reference to undefined identifier: a My end

“Functional programming” has a clear meaning, but does “functional language”?

邮差的信 提交于 2019-12-03 05:36:12
问题 I understand very clearly the difference between functional and imperative programming techniques . But there's a widespread tendency to talk of "functional languages", and this really confuses me. Of course some languages like Haskell are more hospitable to functional programming than other languages like C. But even the former does I/O (it just keeps it in a ghetto). And you can write functional programs in C (it's just absurdly harder). So maybe it's just a matter of degree. Still, even as

Lisp as a Scripting Language in a C++ app [closed]

血红的双手。 提交于 2019-12-03 05:09:07
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Hey, I've been looking at the possibility of adding a scripting language into my framework and I heard about Lisp and thought I would

Is there an equivalent to Lisp's “runtime” primitive in Scheme?

拈花ヽ惹草 提交于 2019-12-03 04:36:40
According to SICP section 1.2.6 , exercise 1.22: Most Lisp implementations include a primitive called runtime that returns an integer that specifies the amount of time the system has been running (measured, for example, in microseconds). I'm using DrScheme , where runtime doesn't seem to be available, so I'm looking for a good substitute. I found in the PLT-Scheme Reference that there is a current-milliseconds primitive. Does anyone know if there's a timer in Scheme with better resolution? current-milliseconds is a function that returns the current millisecond count from the system, but it

Lisp/Scheme interpreter without Emacs?

自古美人都是妖i 提交于 2019-12-03 04:27:46
问题 I've been wanting to teach myself Lisp for a while. However, all the interpreters of which I've heard involve some flavor of emacs. Are there any command line interpreters, such that I could type this into the command line: lispinterpret sourcefile.lisp just like I can run perl or python. While I'd also like to become more familiar with Emacs (if only not to be frustrated when I work with somebody who uses Emacs), I'd rather decouple learning Emacs from learning Lisp. Edit: I actually want to

Why doesn't Scheme support first class environments?

倖福魔咒の 提交于 2019-12-03 04:22:47
问题 I've been reading through SICP (Structure and Interpration of Computer Programs) and was really excited to discover this wonderful special form: "make-environment", which they demonstrate to use in combination with eval as a way of writing modular code (excerpt from section 4.3 on "packages"): (define scientific-library (make-environment ... (define (square-root x) ...))) They then demonstrate how it works with ((eval 'square-root scientific-library) 4) In their example, they then go on to

How to run scheme with Emacs?

泪湿孤枕 提交于 2019-12-03 04:17:01
问题 I followed this tutorial and successfully installed Emacs, STk, Quack. The question is how can I load my program like I do in Racket? In Racket I can edit my code in the upper window, type some codes, save and run. Then the lower window will automatically loaded the code I just wrote. Then I can play with it. I've tried M-x run-scheme. It only brings me into type mit-scheme. Then it says No such file or directory exists. Then I tried F5 (The author from the site wrote a .emacs file enables me

How does code written in one language get called from another language

末鹿安然 提交于 2019-12-03 03:58:27
问题 This is a question that I've always wanted to know the answer, but never really asked. How does code written by one language, particularly an interpreted language, get called by code written by a compiled language. For example, say I'm writing a game in C++ and I outsource some of the AI behavior to be written in Scheme. How does the code written in Scheme get to a point that is usable by the compiled C++ code? How is it used by the C++ source code, and how is it used by the C++ compiled code

Racket URL dispatch

…衆ロ難τιáo~ 提交于 2019-12-03 03:25:15
I'm trying to hook up URL dispatch with Racket (formerly PLT Scheme). I've taken a look at the tutorial and the server documentation. I can't figure out how to route requests to the same servlets. Specific example: #lang scheme (require web-server/servlet) (require web-server/dispatch) (provide/contract (start (request? . -> . response/c))) (define (start request) (blog-dispatch request)) (define-values (blog-dispatch blog-url) (dispatch-rules (("") list-posts) (("posts" (string-arg)) review-post) (("archive" (integer-arg) (integer-arg)) review-archive) (else list-posts))) (define (list-posts

iOS app url scheme list

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Anybody know where I can get list of url scheme for this app's: Pandora Spotify Last.fm I have found this link below, but I think this is not full list of url scheme: http://handleopenurl.com/scheme/pandora http://handleopenurl.com/scheme/last-fm Thanks all for help! 回答1: The apple documentation states there is no comprehensive list, although http://wiki.akosma.com/IPhone_URL_Schemes seems to have an extensive list. 文章来源: iOS app url scheme list