Search Results

Search found 488 results on 20 pages for 'lisp'.

Page 6/20 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Emacs Lisp: How to use ad-get-arg and ad-get-args?

    - by RamyenHead
    I'm not sure I am using ad-get-args and ad-get-arg right. For example, the following code doesn't work. (defun my-add (a b) (+ a b)) (defadvice my-add (after my-log-on activate) (message "my-add: %s" (ad-get-args))) (my-add 1 2) The last expression causes an error: Debugger entered--Lisp error: (void-function ad-get-args). The following doesn't work either. (defun my-substract (a b) (- a b)) (defadvice my-substract (around my-log-on activate) (message "my-substract: %s" (ad-get-arg 0)) (ad-do-it)) (my-substract 10 1) The defadvice gives a warning: Warning: `(setq ad-return-value (ad-Orig-my-substract a b))' is a malformed function And the last expression gives an error: Debugger entered--Lisp error: (invalid-function (setq ad-return-value (ad-Orig-my-substract a b))) (setq ad-return-value (ad-Orig-my-substract a b))() I was trying to use defadvice to watch start-process arguments for debugging purposes and I found my way of using ad-get-arg didn't work.

    Read the article

  • Setting up a non-emacs Common Lisp Dev Env for web application development?

    - by Ravi S
    I am trying to set up a Common Lisp Dev Env for web application development on my Ubuntu 10.04 LTS 64-bit box and I can't find a single decent guide that is targeted at noobs. The closest I came is with Peter Seibel's Lisp in a box but I detest Emacs with a passion and it seems to have older versions of SBCL and CLISP (which are my preferred CL implementations). I do not want to use any of the commercial implementations. I am looking for a simple setup to write some very basic CRUD apps involving possibly hunchentoot, some framework like weblocks,CL-WHO, CL-SQl, sqlite or some datastores from the nosql family like mongo and couch.. Assuming, I go with either SBCL or CLISP on Linux, what is the best tool to manage packages and libraries? ASDF? I am looking for simplicity and consistency and I don't expect to use a ton of libs...

    Read the article

  • Common Lisp implementation with CFFI and thread support on Mac, Windows, and Linux?

    - by mcandre
    Goal: Install Hunchentoot and be able to run Hunchentoot as a background thread. This is what I do: Install Common Lisp. Install Quicklisp. (ql:quickload "hunchentoot") (hunchentoot:start (make-instance 'hunchentoot:acceptor :port 4242)) The last command is supposed to start Hunchentoot, then return to the interpreter for further Common Lisp forms. For CLISP, SBCL, ABCL, ECL, and CCL, I get one of two results: Hunchentoot's dependency Bordeaux Threads fails to install. hunchentoot:start hangs. The web page never loads, and never 404s.

    Read the article

  • What is lisp used for today and where do you think it's going ?

    - by ldigas
    Never been a lisp user, so don't take me as too dense while reading this. But what is lisp used for today ? I know there are several variants of the language in existence, at least one which will keep it alive commercially for a while longer (AutoLisp, VisualLisp - pretty big support from Autodesk) ... but I don't meet everyday people using it. So if you can shed some light on the matter - what is it's primary target market nowadays ? And what do you believe its future will be ... will it become just another support language in few apps, or is it going somewhere ? Also, apart from "an editor whose name shall not be spoken" what other apps keep it as a support language ?

    Read the article

  • Why are C, C++, and LISP so prevalent in embedded devices and robots?

    - by David
    It seems that the software language skills most sought for embedded devices and robots are C, C++, and LISP. Why haven't more recent languages made inroads into these applications? For example, Erlang would seem particularly well-suited to robotic applications, since it makes concurrent programming easier and allows hot swapping of code. Python would seem to be useful, if for no other reason than its support of multiple programming paradigms. I'm even surprised that Java hasn't made a foray into general robotic programming. I'm sure one argument would be, "Some newer languages are interpreted, not compiled" - implying that compiled languages are quicker and use fewer computational resources. Is this still the case, in a time when we can put a Java Virtual Machine on a cell phone or a SunSpot? (and isn't LISP interpreted anyway?)

    Read the article

  • Would Lisp be extremely difficult for a new(ish) programmer to learn?

    - by Rubber Duchy
    I've got a little experience with Python (enough to where I can do if/else/elif and some random number generation), but I've always had a weird fascination with the Lisp languages. I downloaded some scheme source code to look at the syntax but it was pretty much gibberish to me. For a programmer with only a little programming experience like myself, given some good books, websites, and some time, would it be particularly difficult to learn either Common Lisp or Scheme? Which of the two would be easier? How do they compare with Python and C, as far as ease of learning? Thanks

    Read the article

  • C# Dev - I've tried Lisps, but I don't get it.

    - by Jonathan Mitchem
    After a few months of learning about and playing with lisps, both CL and a bit of Clojure, I'm still not seeing a compelling reason to write anything in it instead of C#. I would really like some compelling reasons, or for someone to point out that I'm missing something really big. The strengths of a Lisp (per my research): Compact, expressive notation - More so than C#, yes... but I seem to be able to express those ideas in C# too. Implicit support for functional programming - C# with LINQ extension methods: mapcar = .Select( lambda ) mapcan = .Select( lambda ).Aggregate( (a,b) = a.Union(b) ) car/first = .First() cdr/rest = .Skip(1) .... etc. Lambda and higher-order function support - C# has this, and the syntax is arguably simpler: "(lambda (x) ( body ))" versus "x = ( body )" "#(" with "%", "%1", "%2" is nice in Clojure Method dispatch separated from the objects - C# has this through extension methods Multimethod dispatch - C# does not have this natively, but I could implement it as a function call in a few hours Code is Data (and Macros) - Maybe I haven't "gotten" macros, but I haven't seen a single example where the idea of a macro couldn't be implemented as a function; it doesn't change the "language", but I'm not sure that's a strength DSLs - Can only do it through function composition... but it works Untyped "exploratory" programming - for structs/classes, C#'s autoproperties and "object" work quite well, and you can easily escalate into stronger typing as you go along Runs on non-Windows hardware - Yeah, so? Outside of college, I've only known one person who doesn't run Windows at home, or at least a VM of Windows on *nix/Mac. (Then again, maybe this is more important than I thought and I've just been brainwashed...) The REPL for bottom-up design - Ok, I admit this is really really nice, and I miss it in C#. Things I'm missing in a Lisp (due to a mix of C#, .NET, Visual Studio, Resharper): Namespaces. Even with static methods, I like to tie them to a "class" to categorize their context (Clojure seems to have this, CL doesn't seem to.) Great compile and design-time support the type system allows me to determine "correctness" of the datastructures I pass around anything misspelled is underlined realtime; I don't have to wait until runtime to know code improvements (such as using an FP approach instead of an imperative one) are autosuggested GUI development tools: WinForms and WPF (I know Clojure has access to the Java GUI libraries, but they're entirely foreign to me.) GUI Debugging tools: breakpoints, step-in, step-over, value inspectors (text, xml, custom), watches, debug-by-thread, conditional breakpoints, call-stack window with the ability to jump to the code at any level in the stack (To be fair, my stint with Emacs+Slime seemed to provide some of this, but I'm partial to the VS GUI-driven approach) I really like the hype surrounding Lisps and I gave it a chance. But is there anything I can do in a Lisp that I can't do as well in C#? It might be a bit more verbose in C#, but I also have autocomplete. What am I missing? Why should I use Clojure/CL?

    Read the article

  • s expression representation for c

    - by wirrbel
    Experimenting with various lisps lately (clojure especially) i have wondered if there are any s expression based representations of (subsets) of c, so you could use lisp/closure to write macros and then convert the s-expression c tree to pure c. I am not asking for a to-c-compilers of lisp/scheme/clojure but more of using lisps to transform a c syntax tree. Little background to why i am asking this question: i find myself to really enjoy certain clojure macros like the threading macros -> doto etc. And i feel that they would be great in a non FP environment as well.

    Read the article

  • What should I learn from Scheme?

    - by bunglestink
    I was wondering what unique features I can learn from Scheme that would help me become a better programmer? I have a lot experience in mainstream languages, and I am looking to expand my horizons and learn about functional aspects that are missing from other languages. I am familiar with closures from javascript, lambda expressions from C#, and I was wondering what I can focus on that is lacking in other languages? Aside from the Lisp syntax, I feel like what I have seen so far I've already encountered in other languages. What is unique to Scheme/Lisp that will teach me something new?

    Read the article

  • What are the differences between Bigloo and ECL from an embedding standpoint? [migrated]

    - by Pubby
    I've been looking to embed Lisp in some C++ code. Two options I'm interested in is Bigloo Scheme and ECL (Common Lisp). Reading through the docs they seem to support a very similar feature set. Obviously Bigloo is Scheme and ECL is CLisp, but what other differences do they have? In particular I'm interested in the following criteria: Ease of embedding (for C++, not just C). I don't want to write a bunch of boilerplate. Performance. Bigloo is performance based and has many compiler optimization options, although I can't find anything comparable for ECL. Style of coding. This one is more for Bigloo - is it more functional than ECL? I'm targeting this question towards someone who has used both.

    Read the article

  • Implementing `let` without using a macro

    - by Matt Fenwick
    I'm learning Lisp, and I've just gotten to let, which I don't quite understand (the implementation of). A common definition for it is given in terms of lambda as a macro. However, nowhere have I seen that let must be implemented as a macro or in terms of lambda. Is it possible to define let without using a macro or lambda? I know it can be implemented as a primitive, but I want to know whether it can be implemented in Lisp without creating a macro -- by creating a special form or a function.

    Read the article

  • Is there an equivalent to Lisp's "runtime" primitive in Scheme?

    - by Bill the Lizard
    According to SICP section 1.2.6, exercise 1.22: Most Lisp implementations include a primitive called runtime that returns an integer that specifies the amount of time the system has been running (measured, for example, in microseconds). I'm using DrScheme, where runtime doesn't seem to be available, so I'm looking for a good substitute. I found in the PLT-Scheme Reference that there is a current-milliseconds primitive. Does anyone know if there's a timer in Scheme with better resolution?

    Read the article

  • Common Lisp's equivalent of \r inside the format function?

    - by liszt
    Basically, I'd like to do the following, only using Common Lisp instead of Python: print("Hello world.\r\n") I can do this, but it only outputs the #\newline character and skips #\return: (format t "Hello world.~%") I believe I could accomplish this using an outside argument, like this: (format t "Hello world.~C~%" #\return) But is seems awkward to me. Surely I can somehow embed #\return into the very format string, like I can #\newline? Yeah ehh, I'm nitpicking. Thanks for any help!

    Read the article

  • configuring slime in emacs

    - by CodeKingPlusPlus
    I am in the process of configuring slime for emacs. So far I have read about basic functionality for common lisp such as C-c C-q which invokes the command slime-close-parens-at-point which places the proper number of parens where your mouse is. Another command that seemed cool was invoked by C-c C-c and it would pass the code you are editing in a buffer to the REPL, and "compile" it. Why won't these commands work for me? Anyway, I have downloaded slime via M-x list-packages and do not seem to have this functionality (C-h w and then any of these commands tells me that these commands do note exist). So, I saw a bunch of other slime extensions such as slime-repl', 'slime-fuzzy' and 'hippie-expand-slime'. So I again usedM-x list-packages` and downloaded them. Still I did not have these commands. Here is the content of my emacs file relevant to slime: ;;;Common Lisp and Slime (add-to-list 'load-path "/home/s2s2/.emacs.d/elpa/slime-20130626.1151") (add-to-list 'load-path "/home/s2s2/.emacs.d/elpa/slime-repl-201000404") (add-to-list 'load-path "/home/s2s2/.emacs.d/elpa/hippie-expand-slime-20130226.1656") (add-to-list 'load-path "/home/s2s2/.emacs.d/elpa/slime-fuzzy-20100404") (require 'slime) (setq slime-lisp-implementations `((sbcl ("/usr/bin/sbcl")) (ecl ("/usr/bin/ecl")) (clisp ("/usr/bin/clisp" "-q -I")))) (require 'slime-repl) (require 'slime-fuzzy) (require 'hippie-expand-slime) When I execute M-x slime I get the following message in the inferior-lisp buffer where I can execute common lisp code (however, shouldn't this be the slime-repl since I required it?): STYLE-WARNING: redefining EMACS-INSPECT (#<BUILT-IN-CLASS T>) in DEFMETHOD STYLE-WARNING: Implicitly creating new generic function STREAM-READ-CHAR-WILL-HANG-P. WARNING: These Swank interfaces are unimplemented: (DISASSEMBLE-FRAME SLDB-BREAK-AT-START SLDB-BREAK-ON-RETURN) ;; Swank started at port: 46533. Then a slime-error buffer is created with the contents: Invalid protocol message: Symbol "CREATE-REPL" not found in the SWANK package. Line: 1, Column: 28, File-Position: 28 Stream: #<SB-IMPL::STRING-INPUT-STREAM {10056B9C33}> (:emacs-rex (swank:create-repl nil) "COMMON-LISP-USER" t 5) How should I modify my emacs file to give me the functionality of those commands? In my emacs file am I not loading the necessary files? Do I need to install an additional package? If you need more information let me know! All help is much appreciated!

    Read the article

  • Error while installing emacs23 from Software Center

    - by vrcmr
    Trying to install emacs in Software Center Ubuntu 12.04 got this error. installArchives() failed: Selecting previously unselected package emacs23. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 182385 files and directories currently installed.) Unpacking emacs23 (from .../emacs23_23.3+1-1ubuntu9_i386.deb) ... Processing triggers for desktop-file-utils ... Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for gnome-menus ... Processing triggers for man-db ... Setting up emacs23 (23.3+1-1ubuntu9) ... update-alternatives: using /usr/bin/emacs23-x to provide /usr/bin/emacs (emacs) in auto mode. emacs-install emacs23 install/dictionaries-common: Byte-compiling for emacsen flavour emacs23 Warning: Lisp directory `/usr/share/emacs/23.3/site-lisp' does not exist. Warning: Lisp directory `/usr/share/emacs/site-lisp' does not exist. Warning: Lisp directory `/usr/share/emacs/23.3/leim' does not exist. Warning: Lisp directory `/usr/share/emacs/23.3/lisp' does not exist. Warning: Lisp directory `/usr/share/emacs/23.3/leim' does not exist. Error: charsets directory (/usr/share/emacs/23.3/etc/charsets) does not exist. Emacs will not function correctly without the character map files. Please check your installation! Warning: Could not find simple.el nor simple.elc Cannot open load file: bytecomp emacs-install: /usr/lib/emacsen-common/packages/install/dictionaries-common emacs23 failed at /usr/lib/emacsen-common/emacs-install line 28, <TSORT> line 3. dpkg: error processing emacs23 (--configure): subprocess installed post-installation script returned error exit status 255 No apport report written because MaxReports is reached already Errors were encountered while processing: emacs23 Error in function: Setting up emacs23 (23.3+1-1ubuntu9) ... emacs-install emacs23 install/dictionaries-common: Byte-compiling for emacsen flavour emacs23 Warning: Lisp directory `/usr/share/emacs/23.3/site-lisp' does not exist. Warning: Lisp directory `/usr/share/emacs/site-lisp' does not exist. Warning: Lisp directory `/usr/share/emacs/23.3/leim' does not exist. Warning: Lisp directory `/usr/share/emacs/23.3/lisp' does not exist. Warning: Lisp directory `/usr/share/emacs/23.3/leim' does not exist. Error: charsets directory (/usr/share/emacs/23.3/etc/charsets) does not exist. Emacs will not function correctly without the character map files. Please check your installation! Warning: Could not find simple.el nor simple.elc Cannot open load file: bytecomp emacs-install: /usr/lib/emacsen-common/packages/install/dictionaries-common emacs23 failed at /usr/lib/emacsen-common/emacs-install line 28, <TSORT> line 3. dpkg: error processing emacs23 (--configure): subprocess installed post-installation script returned error exit status 255

    Read the article

  • How does one reduce a list of boolean values in Common Lisp?

    - by postfuturist
    Given a list of values, I want to reduce the list to T if all the elements are not NIL, NIL if not. This gives me an error: (apply #'and (get-some-list)) As does this: (reduce #'and (get-some-list)) This is the best I've come up with: [11]> (defun my-and (x y) (and x y)) MY-AND [12]> (reduce #'my-and '(T T T T T)) T [13]> (reduce #'my-and '(T T T T NIL)) NIL Why is "#'and" invalid? Is there a more idiomatic way to do this in Common Lisp?

    Read the article

  • Is eval the defmacro of javascript?

    - by Florian Margaine
    In Common Lisp, defmacro basically allows us to build our own DSL. I read this page today and it explains something cleverly done: But I wasn't about to write out all these boring predicates myself, so I defined a function that, given a list of words, builds up the text for such a predicate automatically, and then evals it to produce a function. Which just looks like defmacro to me. Is eval the defmacro of javascript? Could it be used as such?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >