3 ms·
Restarts, call/cc, reasonable error reporting, reasonable error reporting, real tail-call elimination.
by imagist 10y ago
Restarts, call/cc, reasonable error reporting, reasonable error reporting, real tail-call elimination.
- dasmoth 10y agoGot you. Once upon a time, there was a serious continuations-on-the-JVM proposal, but it fizzled. Rather sad. Fixnums would also help Clojure.
- foldr 10y agoI thought the general consensus on call/cc now is that although it's very powerful in principle it's not such a great abstraction in practice. It's difficult to implement efficiently and abstractions created using it tend to be very brittle. See e.g.: http://okmij.org/ftp/continuations/against-callcc.html http://okmij.org/ftp/continuations/against-callcc.html
- greghendershott 10y agoRacket provides delimited continuations. The page you linked to is criticizing undelimited continuations -- including quoting Matthias Felleisen -- and contains a link to the following: http://okmij.org/ftp/continuations/undelimited.html#delim-vs-undelim http://okmij.org/ftp/continuations/undelimited.html#delim-vs...
- foldr 10y agoYes I know, but call/cc without any context generally refers to undelimited continuations. Delimited continuations use differently named primitives.
- aidenn0 10y agoIn lisp-like languages I am aware of two implementations of delimited continuations using call/cc (racket and cl-cont) but zero that use shift/reset.
- qwertyuiop924 10y agoWell, real conses would be nice, for a start...
- phyrex 10y agowhy?
- qwertyuiop924 10y agoThere are all kinds of useful structures that you can make out of conses: trees (with two cells per node), infinite lists, and so on. They're also useful in conveying intent.
- phyrex 10y agoI don't see why you can't make those out of the data structures provided - or even the Clojure conses?
- qwertyuiop924 10y agoWell, it's nice to have a uniform cell structure, and you can't make them out Clojure conses, because Clojure conses don't really have a cdr, not as such, as Clojure's cdr cannot contain arbitrary data.
- phyrex 10y agoCan't it? This seems to work just fine: (cons :a (cons '[x] (cons {:foo :bar} #{:x :y}))) and cljs.user=> (rest (cons :a (cons '[x] (cons {:foo :bar} #{:x :y})))) ;=> ([x] {:foo :bar} :x :y) Maybe I don't understand what you mean. I also don't see why a uniform cell structure would be preferable?
- qwertyuiop924 10y agoThe result you got isn't actually what you'd get with proper cons cells. With real conses, you wouldn't get a list, you'd get an improper list, or a pair: i.e: Scheme: (define x (cons 'a (cons 'b '()))) ;> (a b) (define y (cons 'a 'b)) ;> (a . b) (cdr x) ;> (b) (cdr y) ;> b (eq x y) ;> #f If clojure doesn't behave like that, that it's not using real conses. As for why a uniform cell structure is preferable, it's a preference thing, but I feel it makes dealing with lists and other cons-based structure (mostly lists, but you get the occaisional alist or plist or tree in there too) much nicer.