lisp

Tierless web framework with Javascript?

时光总嘲笑我的痴心妄想 提交于 2019-12-03 14:04:50
Links is a lisp-like functional web programming language/framework that makes it easy to write a single piece of code that is compiled to server-side code, client-side JS and HTML, thus making it much easier to write web applications. Since there really is no distinction between the client and server side, they call it "tierless" programming. With the advent of Server-side JS, are there any comparable frameworks with JS? Note that I don't just mean writing server side and client side code in the same language, but writing server-side and client-side functions that can call each other and

Why is the hyphen conventional in symbol names in LISP?

别说谁变了你拦得住时间么 提交于 2019-12-03 14:01:47
What's the reason of this recommendation? Why not keeping consistent with other programming languages which use underscore instead? I think that LISP uses the hyphen for two reasons: "history" and "because you can". History LISP is an old language, and in the early days typing an underscore could be challenging. For example, the first terminal I used for LISP was an ASR-33 teletype . On some hosts and teletype models, the key sequence for the underscore character would be interpreted as a left-pointing arrow (the assignment operator in Smalltalk). Hyphens could be typed more reliably. Because

Really minimum lisp

孤者浪人 提交于 2019-12-03 14:00:25
What is the minimum set of primitives required such that a language is Turing complete and a lisp variant? Seems like car, cdr and some flow control and something for REPL is enough. It be nice if there is such list. Assume there are only 3 types of data, integers, symbols and lists.(like in picolisp) There's a good discussion of this in the Lisp FAQ . It depends on your choice of primitives. McCarthy's original "LISP 1.5 Programmer's Manual" did it with five functions: CAR, CDR, CONS, EQ, and ATOM. The lambda calculus is turing complete. It has one primitive - the lambda. Translating that to

How to run Clozure CL (Lisp) from a shell script on OS X?

倖福魔咒の 提交于 2019-12-03 12:56:40
I tried the following: $ cat args.sh \#! /Applications/ccl/dx86cl64 (format t "~&~S~&" *args*) $ ./args.sh Couldn't load lisp heap image from ./args.sh I can run lisp fine directly: $ /Applications/ccl/dx86cl64 Welcome to Clozure Common Lisp Version 1.5-r13651 (DarwinX8664)! ? Is it possible to write a shell script to run lisp code with Clozure CL? I am sure I am doing something silly. I installed it from: http://openmcl.clozure.com/ Just following up on Charlie Martin's answer and on your subsequent question. The dx86cl64 --eval <code> will fire up a REPL, so if you want to fire up a given

Common Lisp Compiling and execution time

瘦欲@ 提交于 2019-12-03 12:52:23
I have a lisp file which does lots of sampling, file I/O and arithmetic in a loop. (I do particle filtering in common lisp.) I am compiling my lisp file using the compile-file command. I also use the (declaim (optimize (speed 3) (debug 0) (safety 0))) at the beginning of my lisp file as I want to have my results as fast as possible. I use (time (load "/....../myfile.lisp") and (time (load "/......./myfile.dx64fsl") to measure speed. The issue is that compiling does not bring any advantage to me. There is no improvement. Do I do something wrong? Is there a way to improve things? Speed is the

Interact with a locally long-running Common Lisp image, possibly daemonized, from the command line

不想你离开。 提交于 2019-12-03 12:50:53
How could one interact with a locally long-running Common Lisp image, possibly daemonized, from the command line? I know it is possible to run a Common Lisp function from a Terminal command prompt , I am also aware of this . I would need to do a similar thing, but with a local, already long-running Common Lisp image, being able to poll available functions from the CLI or shell scripts. Is there a way to do that from a CLI, for example calling a function from a bash script, and receiving back whatever the function returns? I though one could, for example, create a primitive web service, perhaps

How to understand clojure's lazy-seq

寵の児 提交于 2019-12-03 12:45:36
问题 I'm trying to understand clojure's lazy-seq operator, and the concept of lazy evaluation in general. I know the basic idea behind the concept: Evaluation of an expression is delayed until the value is needed. In general, this is achievable in two ways: at compile time using macros or special forms; at runtime using lambda functions With lazy evaluation techniques, it is possible to construct infinite data structures that are evaluated as consumed. These infinite sequences utilizes lambdas,

elisp: Is there a way to get the name of the current .el module (like __FILE__ in C)?

不羁的心 提交于 2019-12-03 12:14:15
At the top of my elisp module, I want to do something as simple as: (message (concat "Loading " (expand-file-name (current-elisp-module) "."))) You can use the variable load-file-name , which is set by the function load , documented as follows: Full name of file being loaded by `load'. As elaborated in the manual: When Emacs is in the process of loading a file, this variable’s value is the name of that file, as Emacs found it during the search described earlier in this section. Note: buffer-file-name as a routine does not work as you might expect it to. 来源: https://stackoverflow.com/questions

Which environment, IDE or interpreter to put in practice Scheme?

戏子无情 提交于 2019-12-03 12:10:12
问题 I've been making my way through The Little Schemer and I was wondering what environment, IDE or interpreter would be best to use in order to test any of the Scheme code I jot down for myself. 回答1: Racket (formerly Dr Scheme) has a nice editor, several different Scheme dialects, an attempt at visual debugging, lots of libraries, and can run on most platforms. It even has some modes specifically geared around learning the language. 回答2: I would highly recommend both Chicken and Gauche for

How to create dynamical scoped variables in Python?

六眼飞鱼酱① 提交于 2019-12-03 12:06:07
问题 I am translating some code from lisp to Python. In lisp, you can have a let construct with the variables introduced declared as special and thus having dynamic scope. (See http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping) How can I do likewise in Python? It seems the language does not support this directly, if true, what would be a good way to emulate it? 回答1: I feel Justice is plain right in his reasoning here. On the other hand -- I can't resist implementing proof of concept for