soegaard


8 points by soegaard over 2 years ago | link
cached 6 days ago

7 points by soegaard over 2 years ago | link | parent | top
cached 8 days ago
Yes, which is why DrScheme restarts the REPL everytime the run button is used.

See http://list.cs.brown.edu/pipermail/plt-scheme/2008-February/... for a more elaborate explanation.


6 points by soegaard over 2 years ago | link | top
cached 6 days ago
PLT Scheme:

  (require  (lib "match.ss"))

  (define (rpn xs) (rpn2 (list xs ())))
  (define rpn2
    (match-lambda
      [(() (x))                              x]
      [(()  xs)                              (error "extra stuff on stack")]
      [(('/ . _) (0 . _))                    (error "divisision by zero")]
      [(((and a (? symbol?)) . b) (x y . r)) (rpn2 (list b (cons ((eval a) y x) r)))]
      [((a . b) s)                           (rpn2 (list b (cons a s)))]))

  (rpn '(2 2 + 9 1 - /))
  (rpn '(2 2 + 9 9 - /))

5 points by soegaard over 2 years ago | link | parent | top
cached 7 days ago
Arc uses the PLT Scheme reader. The PLT Scheme reader has a non-standard (as compared to RnRS) extension, namely the double-dot notation. The double-dot notation is used to write "infix expressions".

Consider:

  (x . < . y)  is turned into  (< x y)
  (integer? boolean? . -> . void?) is turned into (-> integer? boolean? void?)
This reader extension can be turned off, but setting the appropriate parameter.

5 points by soegaard over 2 years ago | link | parent | top
cached 2 days ago
Matthew Flatt.

"Composable and Compilable Macros: You Want it When?".

International Conference on Functional Programming

(ICFP'2002)

http://www.cs.utah.edu/plt/publications/macromod.pdf

And you are right, making modules and macros work together turns out to be harder than most people realize. Schemers have thought long and hard about the problem. It would be wise to look at the papers at

    http://library.readscheme.org/page5.html
before designing a module system.

4 points by soegaard over 2 years ago | link | parent | top
cached 13 days ago
Implementing call/cc efficiently has been well-reasearched in the Scheme community. For a very well-written account of a non-stack-copying implementation see

R. Kent Dybvig. "Three Implementation Models for Scheme". PhD. Thesis. http://www.cs.indiana.edu/~dyb/papers/3imp.pdf

Then continue at ReadScheme at "Compiler Technology/Implementation Techniques and Optimization" to see further developments (Look especially for Clinger's papers).

http://library.readscheme.org/page8.html


4 points by soegaard over 2 years ago | link | parent | top
cached 7 days ago
An instance of MzScheme will only use one cpu even on multi-cpu machines. In order to use more than one cpu, start several instances and let them communicate either via tcp or via files.

4 points by soegaard over 2 years ago | link | parent | top
cached 5 days ago
Never mind the example. What troubles me with the the-code-is-the-spec approach, is that for an outsider, it is impossible to tell which decisions where made deliberately and which were accidental.

Just for the record, I find it is fair game to say there is no specification, while the experimentation phase is still going on.


3 points by soegaard over 2 years ago | link | parent | top
cached 14 days ago
It is actually easy to underestimate DrScheme. It's not just for beginners, but also for wizards.

3 points by soegaard over 2 years ago | link | parent | top
cached 14 days ago
For editing text Vi and Emacs are preferred by quite a few hackers.

However for editing Scheme, DrScheme is the best choice. Not because it is "graphical", but simply because it was designed with one purpose only: writing Scheme code.

It has all the standard stuff (such as: to show the documentation on an identifier just press F1), but it also contain the Scheme specific stuff, that you won't notice until you try some advanced Scheming.

Among the most impressive features is how precise the error messages are reported. This goes for both standard errors, but not the least when macros are involved. If you compare the error reports you get from a few errorneous macros in DrScheme and in a standard Scheme implementation, you'll see that you can save a lot of time if you use DrScheme.

And while at, don't forget try the macro stepper...