lisp

What are the advantages of scheme macros?

核能气质少年 提交于 2019-12-02 22:11:53
Why would anyone prefer Scheme macros over Common Lisp macros (and I genuinely want to know too, I'm not trying to be a troll)? My experience as a Lisp newb is that Common Lisp style macros are much easier to learn than Scheme's macros. I have yet to see any advantages to Scheme's macros, but of course that doesn't mean they don't exist. I do know that Scheme macros are "hygenic", but I'm still not convinced this is worth the additional complexity. On the other hand though, there obviously are people that are convinced that this is necessary, otherwise there wouldn't be implementations of

Apache + mod_lisp + clisp

冷暖自知 提交于 2019-12-02 20:55:47
How to to configure apache + mod_lisp + clisp and set up a "Hello World!"? I couldn't find any complete howto on the subject. Thanks. Edit: Vebjorn's solution works, but then I don't how to code the "hello world!". Can anyone tell me how to proceed? There's something like SWANKing the clisp, then connect to it with SLIME, but then when I launch mod_lisp's demo, the test page is not served and my slime doesn't return? Thanks again. Download http://www.fractalconcept.com:8000/public/open-source/mod_lisp/mod_lisp.c Compile and install Apache module with sudo apxs -i -c mod_lisp.c Add the

How do I get a list of Emacs lisp non-interactive functions?

梦想与她 提交于 2019-12-02 20:54:14
How do I get a complete list of non-interactive functions that I can use in Emacs Lisp? The interactive ones are easy enough to find in the help system, but I want a complete list of all the other functions I can use. For example concat , car , cdr , etc. (And preferably with documentation). Thanks Ed Edit: Answered thanks to Jouni. I played around with his answer a bit, and got it to sort the results (using the results of his code to help me find the correct sorting function!) (flet ((first-line (text) (if text (substring text 0 (string-match "\n" text)) ""))) (let ((funclist (list)))

Fixing Lisp Syntax

穿精又带淫゛_ 提交于 2019-12-02 20:48:41
Being a newbie to Lisp I'm wondering if the Lisp syntax could be "fixed"? Some people say the syntax in Lisp is one of its biggest strengths. I don't quite understand this. Isn't it possible to replace "obvious" parentheses with a combination of white spaces, new lines and indenting? Just like in Python? It looks to me like parentheses are the most used characters in Lisp code. I'm wondering if that's true - but if it is, isn't this a suggestion, that there is some redundancy in the syntax? Is there some simple answer to the question - why so many parentheses? For example: (defun factorial (x)

A simple example of using the stepper in SBCL

扶醉桌前 提交于 2019-12-02 20:47:41
Going through the computation with the LispWorks stepper is rather intuitive, but I cant figure it out in SBCL. Can somebody please give me a step-by-step example of how to use the SBCL stepper in the REPL on some simple function? Thanks. * (proclaim '(optimize (debug 3))) * (defun foo (a b) (* (+ a b) b)) FOO * (step (foo 1 2)) ; Evaluating call: ; (FOO 1 2) ; With arguments: ; 1 ; 2 1] step ; Evaluating call: ; (+ A B) ; With unknown arguments 0] step ; Evaluating call: ; (* (+ A B) B) ; With unknown arguments 0] step ; (FOO 1 2) => 6 Commands: Stepping: START Selects the CONTINUE restart if

How can I run SBCL code under a Unix-like operating system in a convenient way?

给你一囗甜甜゛ 提交于 2019-12-02 20:29:18
(David James both wrote the question and an answer. I'll edit it to conform to Stackoverflow standards.) Using SBCL you can compile Lisp code to machine code. Like Java, .net, C++ and even C you will need the runtime. So there are two ways to compile Common Lisp code. First is to make huge binaries which is explained in SBCL documentation. No SBCL needed on target machine. The other way is a more flexible one, which is to create machine code in a fasl (FASt Load) format. The SBCL runtime is needed on the target machine. How does the second way work under a Unix-like operating system? Rainer

Functional Programming in C# vs LISP [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 20:13:02
What are the primary differences between LISP and C# with regards to functional programming? In specific, if a LISP programmer was to switch to using C#, what are the features they are most likely to miss? MichaelGG Doing functional programming in C# is technically possible (well, any language that has function pointers or delegates equivalent can be "functional") -- but C# gets very very painful if you try to do much. Off the top of my head, in no particular order: Type inference Only exists for locals now Should apply to pretty much everything The #1 problem I have with C# is this.

What is ' (apostrophe) in Lisp / Scheme?

自闭症网瘾萝莉.ら 提交于 2019-12-02 19:55:47
I am on day 1 hour 1 of teaching myself Scheme. Needless to say, I don't understand anything. So I'm reading The Little Schemer and using this thing: http://sisc-scheme.org/sisc-online.php as an interpreter. I need to use ' in for example (atom? 'turkey) to avoid an "undefined variable" error. The ' , according to the book, is a Common Lisp thing. I have two questions: Is the interpreter I mentioned above a good one? Can you recommend another? I need one that will go well with The Little Schemer . What is ' ? The form 'foo is simply a faster way to type the special form (quote foo) which is to

Has anyone got any code examples of ECL Lisp for Iphone development?

天大地大妈咪最大 提交于 2019-12-02 19:39:53
I found out about Lisp for the Iphone recently and wanted to find some code examples. https://github.com/TerjeNorderhaug/ecl-iphone-builder/#readme The ECL for iOS distribution includes a code example of a Common Lisp application running on the iPhone. The example is a Swank server, the backend for the SLIME and MCLIDE Lisp development environments (disclosure: I am the developer of the latter). Following the steps in the readme will build the application and place it on your iPhone/iPad, or alternatively on the iPhone simulator that comes with Xcode. You can then connect to the iOS device

Common Lisp scoping (dynamic vs lexical)

天大地大妈咪最大 提交于 2019-12-02 19:37:45
EDIT: I changed the example code after the first answer because I came up with a simple version that begs the same questions. I am currently learning Common Lisp's scoping properties. After I thought I had a solid understanding I decided to code up some examples that I could predict the outcome of, but apparently I was wrong. I have three question, each one relating to an example below: Example 1: (defmethod fun1 (x) (print x) (fun2)) (defmethod fun2 () (print x)) (fun1 5) Output: 5 *** - EVAL: variable X has no value Question: This makes sense. x is statically scoped and fun2 has no way of