scheme continuations for dummies

Forget about call/cc for a moment. Every expression/statement, in any programming language, has a continuation – which is, what you do with the result. In C, for example, x = (1 + (2 * 3)); printf (“Done”); has the continuation of the math assignment being printf(…); the continuation of (2 * 3) is ‘add 1; … Read more

Lisp and Prolog for Artificial Intelligence? [closed]

The question has already been answered for Lisp, so I’ll just comment on Prolog. Prolog was designed for two things: natural language processing and logical reasoning. In the GOFAI paradigm of the early 1970s, when Prolog was invented, this meant: constructing symbolic grammars for natural language that would be used to construct logical representations of … Read more

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

current-milliseconds is a function that returns the current millisecond count from the system, but it might decrease. current-inexact-milliseconds is similar, but returns a guaranteed-to-increase floating point number. There are also a bunch of similar functions that you can find on that page, but if all you need is to time a certain function, then just … Read more

Porting Common Lisp code to Clojure

There’s a list on clojure.org of differences between Clojure and other Lisps. Some other things I’ve noticed using Clojure: Idiomatic Clojure leans heavily toward immutable data structures. Anywhere you see SETF in CL may have to be changed in Clojure to take full advantage. (You always have the option of using mutable Java data structures … Read more

Lisp Code Formatting

The closing parentheses on extra lines don’t really help with seeing the structure of the code, because you can get the same information from the level of indentation. However, the second form takes up almost twice as many lines, forcing you to scroll more often when reading code. And if you need to inspect the … Read more

How is Lisp dynamic and compiled?

Lisp is a wide family of language and implementations. Dynamic in the context of Lisp means that the code has a certain flexibility at runtime. It can be changed or replaced for example. This is not the same as dynamically typed. Compilation in Lisp Often Lisp implementations have a compiler available at runtime. When this … Read more

let vs def in clojure

The problem is that your use of let is wrong. let works like this: (let [identifier (expr)]) So your example should be something like this: (let [s (Scanner. “a b c”)] (exprs)) You can only use the lexical bindings made with let within the scope of let (the opening and closing parens). Let just creates … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)