totonex wrote:I am very new to pretty much everything is LISP, and what LISP is.
One thing you need to know: ever since lowercase letters have been invented, Lisp is known as Lisp, and LISP with all capital letters refers to old dialects which are now mostly a historical curiosity.
totonex wrote:I have an assignment to do, and i've decided it would be best to do it in LISP.
How much time do you have for this assignment? If you do not know anything about Lisp, then setting the system up and learning the basics might take some time. Trying to cargo-cult a solution rarely works well, and there is a number of things in most Lisps which are somewhat different from many other popular languages, so it is even harder.
totonex wrote:What i'm supposed to do is make a desktop application in C# which gets the HTML from some page, and using regex, extract some very specific text from it.
Using regular expressions on HTML is generally not recommended, which is stated eloquently in this StackOverflow answer
. Are regexes actually in problem statement? If so, and this is part of some formal education, then I would suggest changing schools
And obviously wouldn't a C# requirement conflict with implementing the solution in Lisp?
totonex wrote:First of all, i have Emacs + CL Lisp, and LispWorks (which works with CL).
LispWorks is an implementation of CL, not "works with CL", whatever that means. Common Lisp is a language standarized by ANSI, and there are many implementations
of that standard. The CL package for Emacs is not
one of them, it just provides a layer of some useful functions and macros to mimic some CL features, but is hardly complete.
totonex wrote:1. Should i do a console application which does this? 1b. How do i make a console application in emacs?
2. Should i use LispWorks to make a fancy desktop app.
How should we know? You should do what you want/need to do. Not most likely something running inside Emacs, that wouldn't make much sense. It is possible to use Emacs in batch mode like this, but that doesn't really make sense in this case. If you have full version of LispWorks you could create a command line application in that, or use some open source CL implementation.
totonex wrote:3. Should i not use CL, but use Clojure? //clojure's just fancy.
Clojure requires Java Virtual Machine and using Java libraries for many things. If you already are comfortable with Java environment, the you can. I am not sure if there are many people on this forum using Clojure though, so if you choose to do so you might want to look for help elsewhere.
totonex wrote:4.Can someone give me some insight on functions to use to get HTML from a specific URL, and do i still need regex for getting my specific information? If so, what support does CL for the matter?
LispWorks probably provides all of that functionality built in somehow. Since I have more experience with open source implementations, I would use drakma
to download the data, and closure-html
to parse it and extract information from it. If you really want regular expressions there is cl-ppcre
. All those work with LispWorks as well, of course.
Installing those libraries and their dependencies is best achieved using clbuild
, preferably on a sane operating system, and learning to use ASDF
(there is a basic tutorial here
). The language in general is best learnt from book like Practical Common Lisp