ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Which is obviously wrong, the culprit is an extra close paren on the first line (I highlighted it). Also, the the general structure of an if form looks like this:
Code:
(if <TEST>
<THEN>
<ELSE>)
There are no keywords apart from the "if" itself, and you don't need to repeat/reverse the test.
Use 'string=' rather than '=' for the comparison, or you'll likely get a "Not a Number" error. Also, read will likely uppercase the input unless you take steps to prevent it (google readtable-case), so you need to compare with "Y" not "y".
And yeah, an editor that does parenthesis matching/highlighting is a must have when you're doing lisp, otherwise you'll go insane.
With a new language seemingly appearing every other month, lisp still has (new) adherents ????.
Memories from the 70s struggle to emerge...
The new languages, imho, haven't improved computer science -- mostly just vanity (see I made a programming language, too), or economic power trips (we'll make our own language for our platform, and when developers use our language, it will advance our platform) This doesn't advance computer science, but rather obfuscates it by making it less homogenous for no reason other than vanity and greed.
Way to see through the crud, Petr Strajt: welcome to secret alien technology!
When I graduated, I had to move state to get a job because I hadn't taken the optional COBOL units (it was a while ago). Nobody gave a damn about the nicities of compsci - they wanted people who could help the business run the business that made them money.
Dunno what the job market is these days tho'.
Yabbut - is it going to get the OP a job ?.
...
Dunno what the job market is these days tho'.
Yes, there are common lisp jobs -- often one must search for functional programming... and common lisp has bindings to so many other languages, that you can take, for example, a job building qt widgets, and use commonqt/smoke to create the widgets... good employers don't care how you do it as long as you do it. The job title might not say lisp or functional programming, but instead say qt. There's heaps of medical statistics jobs these days, mostly using R. But common lisp has you covered with bindings to R as well.
Of course, you have to want a job in the first place...
I remember seeing a visual interface to the LISP programming language which simply presented the inherent list/node structure of a program in a graphical way. You could open the program with it, change it visually, and then save it. IIRC, it also had the ability to recognize syntax errors. Unfortunately, I no longer remember what it was called. (AutoCAD has something called "Visual LISP" which is not the same thing.)
One thing's quite sure, though: "LISP will never die." Possibly the very-earliest language ever invented.
i havent logged in, in so long and finally i did and noticed a LISP! question , and on a not too ancient thread either, well if incase someone sees this i'll leave my own 2 cents here
Quote:
Use 'string=' rather than '=' for the comparison, or you'll likely get a "Not a Number" error. Also, read will likely uppercase the input unless you take steps to prevent it (google readtable-case), so you need to compare with "Y" not "y".
or you can just use string-equal since that is case insensitive that way you can accept both cases of y or Y without resorting to a cond or a nested if, for more concise code,
to run firefox with an optional specific url in mind.
TIP: also dont get used to setq just use setf when mutating bindings
you can also write your code by defining a function instead and just using let for variable declaration, for ex:
Quote:
(defun run-firefox-run ()
(write-line "Do you want to run Firefox? y/n")
(let ((answer (read))
...etc-etc))
P.S. I'd also like to suggest for beginners interested in learning Lisp, to try to use Racket first instead of Common Lisp, its just easier to get set up in the beginning, super easy brain dead simple install, and Racket comes with an IDE thats easy to use right at the start so you dont get overwhelmed and learn without much distraction unlike starting with Common Lisp theres plenty much to learn and configure before you get going which detracts from the learning, then after you can switch to Common Lisp, when you get your bearings, if you still want to that is, as Racket is plenty capable as a Lisp(but as a Scheme derivative Lisp dialect with batteries included), but hey Common Lisp Rocks too, you cant beat SLIME on EMACS
Last edited by 0++; 06-26-2022 at 12:53 AM.
Reason: cant seem to fix the indentation of the code oh well
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.