lisp

How can I do web programming with Lisp or Scheme?

不打扰是莪最后的温柔 提交于 2019-12-04 07:22:06
问题 I usually write web apps in PHP, Ruby or Perl. I am starting the study of Scheme and I want to try some web project with this language. But I can't find what is the best environment for this. I am looking for the following features: A simple way of get the request parameters (something like: get-get #key, get-post #key, get-cookie #key). Mysql access. HTML Form generators, processing, validators, etc. Helpers for filter user input data (something like htmlentities, escape variables for put in

How to read mentally Lisp/Clojure code

佐手、 提交于 2019-12-04 07:21:08
问题 Thanks a lot for all the beautiful answers! Cannot mark just one as correct Note: Already a wiki I am new to functional programming and while I can read simple functions in Functional programming, for e.g. computing the factorial of a number, I am finding it hard to read big functions. Part of the reason is I think because of my inability to figure out the smaller blocks of code within a function definition and also partly because it is becoming difficult for me to match ( ) in code. It would

Why should I learn Lisp? [closed]

青春壹個敷衍的年華 提交于 2019-12-04 07:20:00
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I really feel that I should learn Lisp and there are plenty of good resources out there to help me do it. I'm not put off by the

Is there a software-engineering methodology for functional programming? [closed]

只愿长相守 提交于 2019-12-04 07:17:32
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . Software Engineering as it is taught today is entirely focused on object-oriented programming and the 'natural' object-oriented view of the world. There is a detailed methodology that describes how to transform a domain model into a class model with several steps and a lot of (UML

Are Project-Specific DSLs a Liability? [closed]

早过忘川 提交于 2019-12-04 07:15:58
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . I've forked this question from a similar question I made in a comment I made to one of the many great answers I recieved. I was originally asking about AST macros, which mostly provoked very detailed and thoughtful responses from Lispers. Thanks. Lazy Evaluation vs Macros The question I made in a comment was whether project-specific DSLs are actually a good idea. Of course, this is completely

How do I install LFE on Ubuntu Karmic?

好久不见. 提交于 2019-12-04 07:12:58
Erlang was already installed: $dpkg -l|grep erlang ii erlang 1:13.b.3-dfsg-2ubuntu2 Concurrent, real-time, distributed function ii erlang-appmon 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP application monitor ii erlang-asn1 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP modules for ASN.1 support ii erlang-base 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP virtual machine and base applica ii erlang-common-test 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP application for automated testin ii erlang-debugger 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP application for debugging and te ii erlang-dev 1:13.b.3-dfsg-2ubuntu2 Erlang/OTP development libraries

defun with a list as argument

我怕爱的太早我们不能终老 提交于 2019-12-04 06:39:54
I'm trying to pick up Lisp as my new language, and I'm having some issues working out how to have parts of a function work on each element of the list passed to it. For the purpose of learning how to get around this, I am trying to write a fairly basic form of division does not croak when one of the elements of the list are 0 (but instead just returns 0) (defun divtest (elements) (dolist (x elements) (if (zerop x) 0 () ) (/ elements))))) I try to run this as: (divtest '(20 2 5)) Which yields: *** - /: (20 2 5) is not a number The point of failure seems to be rooted in the fact that i am not

What is wrong with my emacs/slime setup (compile-and-load/eval not working)?

我们两清 提交于 2019-12-04 06:32:53
I can run emacs and start slime (with M-x slime ). At this point I get the REPL in the inferior-lisp buffer and can run lisp there. But when I open up lisp code in another buffer none of the slime-goodness works ( C-x C-e , C-c C-k etc.) and I keep seeing this in the Messages buffer (with an increasing count-number): slime-connection: Not connected. Polling "/var/folders/B9/B9B5J15dH+aNt5J5gkROEk+++TI/-Tmp-/slime.3202".. (Abort with `M-x slime-abort-connection'.) [69 times] Makes me think slime is not connecting to the correct lisp interpreter, but since I am very new to emacs and lisp I am

Writing a ++ macro in Common Lisp

走远了吗. 提交于 2019-12-04 06:29:43
I've been attempting to write a Lisp macro that would perfom the equivalent of ++ in other programming languages for semantic reasons. I've attempted to do this in several different ways, but none of them seem to work, and all are accepted by the interpreter, so I don't know if I have the correct syntax or not. My idea of how this would be defined would be (defmacro ++ (variable) (incf variable)) but this gives me a SIMPLE-TYPE-ERROR when trying to use it. What would make it work? Kyle Cronin Remember that a macro returns an expression to be evaluated. In order to do this, you have to

Writing recursive GCD in Lisp

谁说胖子不能爱 提交于 2019-12-04 06:29:03
问题 I keep getting random errors when compiling this function: (defun gcd (a b) (if (= b 0) a (gcd b mod (a b)))) The most common is that it says "undefined function a." So I figured I needed return a in that place. This did not work. I get a to many parameters for if statement error. Any idea what I am doing wrong here? New to Lisp and so far we are not seeing eye to eye. Running on CLISP on Windows 7. 回答1: In Lisp a function call always* starts with '(', so the line (gcd b mod(a b)) means "call