freenode/#lisp - IRC Chatlog
Search
16:29:18
beach
neeasade: People probably don't know what cider is, so you are better off explaining what you want.
16:32:10
minion
saravia: look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
16:36:51
neeasade
beach: thanks, I will clarify -- there is an emacs package, eros, that displays eval result overlays in the buffer. it looks like this: https://0x0.st/zb4q.png . I was hoping for something similar for slime/CL
17:19:17
defunkydrummer
minion: memo to pjb: minion isn't working, thanks for the memo (read it on lisp logs instead)
17:19:18
minion
defunkydrummer, memo from pjb: on MS-Windows, you can use Clozure CL; with it's FFI (using CFFI), you can access all the MS-Windows API, including to implement native GUI.
17:20:28
defunkydrummer
saravia, PuercoPop and myself are in the same city. This brings me most-positive-fixnum happiness.
17:47:32
neeasade
for anyone interested, I was able to hack it into eros's existing wrapper. https://pastebin.com/raw/RNEyVgxp
17:49:44
_death
neeasade: no, mine :) https://github.com/death/slime/commit/86e71491e3d96b7530e22ed5d8073fb6445d8f9a
17:50:46
neeasade
phoe: thanks, I'll look into it, I may just end up posting the final thing on #emacs or #lisp
18:22:40
puchacz
hi, is Clasp easy to use (say like SBCL) or it is more for adventurous people who know C++ etc.? somebody said here that ECL is for adventurous people, and I saw youtube video about Clasp where drmeister said the Clasp code was largerly taken from ECL....
18:24:04
minion
pjb, memo from defunkydrummer: minion isn't working, thanks for the memo (read it on lisp logs instead)
18:25:02
pjb
puchacz: the only thing that will look different to a normal lisper, is that ecl doesn't save lisp images. So when you launch a program build from ecl, you don't restore a lisp image, but it's like if you loaded all the object files.
18:25:37
shka_
and compiler is not that fast, but that's because it delegates actual compilation to GCC
18:25:57
pjb
puchacz: on the other hand, when you need to interface with C or C++, you see the advantages of ecl. Or when you use it in a foreign program as the libecl library.
18:26:53
puchacz
ABCL does not use images either, it would be a problem if I was deploying applications (even to a server) but when I use it at work to script around our huge Java application locally to investigate or test something, it is no problem at all.
19:21:51
TheWild
okay, it's not about parentheses. It's about the Lisp's prefix notation. How do you read it?
19:24:21
pjb
TheWild: you watch the first symbol in the list. If it's the name of a special operator, you interpret the rest according to the special rules of this special operator.
19:25:25
pjb
TheWild: otherwise, it must be a function name, or a lambda-expression designating an anonymous function. Then you must evaluate the remaining elements in the list in order, keep the main results, and pass them as argument to the function named by the first element.
19:25:59
TheWild
sure thing for very small programs. When the program gets a little bigger, all I see is a soup or numbers, keywords and operators.
19:28:20
pjb
TheWild: you can always ask here or in #clschool if you have a problem with a specific example.
19:28:51
pjb
TheWild: I would advise an exercise: write a lisp function to take a lisp expression, and print out an explaination of it.
19:48:20
phoe
and if you want to see what reader macros are capable of, see https://github.com/y2q-actionman/with-c-syntax
19:49:36
phoe
also what shka_ said - if you want to see what they can do, take a look at them; but never start learning Lisp by learning how to write macros
19:49:52
TheWild
ah, \( and \). I thought I could just overwrite the bare fundamentals and... well, I couldn't imagine it.
19:49:57
phoe
you actually have to have a good understanding of list processing in Lisp to be able to write somewhat complicated ones.
19:51:03
shka_
your macros don't make lisp powerful, your macros can be powerful thanks to everything else in the lisp
19:52:08
shka_
TheWild: don't waste your time, learn how to write your usual code good enough, once you have that learning everything else will become just that much easier
19:54:02
TheWild
I'm curious how ( and ) inside #{ }# has not been inrepreted as subexpression... or maybe it was?
19:54:48
phoe
TheWild: reader macros are functions that take arbitrary input from the input stream and pop out Lisp expressions
19:54:59
phoe
how they do that - it's up to them, they can execute arbitrary Lisp code as a part of their processing
19:55:15
TheWild
about month ago I was learning lambda calculus and SK combinator calculus. I've no idea how I ended up there though.
19:55:59
shka_
TheWild: once again, you don't know how lisp lexical scope works, how special variables work, how packages work and what is the symbol datatype
19:56:53
TheWild
so even if I'm not going to write any good Lisp code, I'd like to see what others have invented.
19:57:08
phoe
TheWild: basically, learn yourself some Lisp, and a) you will be able to write crazy shit like this, b) you will learn yourself a stable, interactive and bendy programming language along the way
19:57:59
defunkydrummer
TheWild: or even macros. Start with the real basics like let, defun, cond, format, then maybe loop, then some list operations like mapcar, append, reverse, push
19:59:27
defunkydrummer
i guarantee you'll find pleasant surprises even by doing regular lisp code without clos or reader macros.
20:00:49
phoe
so did I, and it doesn't do any weird syntax shit - it just marks some expressions as test steps in my library for describing test cases/test steps
20:06:07
phoe
hey, my reader macro is exactly for debugging things, it tells me which test step screwed up during running tests
20:09:36
MichaelRaskin
Testing your implementation of \v by comparing it to the C compiler's \v without having any idea what \v is!
20:29:31
aeth
You basically never need reader macros. e.g. Let's say you're writing a bunch of hash-tables that start with certain values and you want to make that easier. Is #h(:foo 42 :bar 43) as a hash-table reader-macro really better than (hash :foo 42 :bar 43) as a hash-table regular-macro? The reader macro makes everything harder, and the editor probably thinks ":foo" is special, and what if :foo is (+ x y) instead?
20:29:38
TheWild
ah, this explains why the weird thing was happening. I thought I'll get a reference to the body of +
20:30:30
jackdaniel
reader macros are useful when you want to augument syntax (i.e parse commas as separators), it is never needed for ordinary lisp code
20:31:04
phoe
TheWild: also, Common Lisp is a Lisp-2 - in very basic terms, it means that + can name multiple things - in standard CL, the symbol + names both a variable and a function
20:31:14
TheWild
if all the code is a list then in theory I could (execute-here function-body) or (translate-to-something-else function-body)
20:31:35
phoe
(even though it has N namespaces, because there are a few more namespaces in the standard and then also programmers can define their own)
20:31:54
jackdaniel
it means that it has two different namespaces for variables and functions, there are certainly more namespaces
20:32:18
phoe
neeasade: variables, functions, classes, tagbody tags, catch tags, restarts... I forgot one I think, but whatever
20:32:42
neeasade
I'm coming to cl from elisp, which is also a lisp-2, so it feels a little natural already
20:32:58
jackdaniel
namespaces are quite arbitrary, you may assign a special meaning to a name in your own interface and you have one new namespace
20:34:02
phoe
functions are defined via DEFUN forms or LAMBDA forms which are lists, but once these forms are evaluated, function objects are created
20:34:34
aeth
TheWild: I think you mean (eval function-body) and that can only happen if you save the function's source somewhere (the function is compiled). You could have a macro that has two effects, though, one being a defun and the other saving the definition. It's not quite as simple as a direct eval because that would only work for (defun foo () "Hello") and not (defun foo (x) (format nil "Hello, ~A~%" x)) because (eval `(format nil "Hello, ~A~%"
20:34:50
neeasade
that's why macros are fun, because in that phase you can treat the code as a list and do those kinds of transformations
20:34:53
phoe
but just as jackdaniel said - since Lisp code is lists, it can be treated as data, and you can operate on it using normal list-processing functions
20:34:55
aeth
in case that got cut off: because (eval `(format nil "Hello, ~A~%" x)) won't know what x is.
20:36:16
jackdaniel
phoe: I did not mean that. I meant what I said: you may take a function, assign it to a variable and pass it to another function, and that code is manipulated with macros (so it is treated as argument). not that you may code-walk it
22:22:19
neeasade
hello #lisp, I'm trying to grok quicklisp -- as a test, I randomly picked the package "cl-speedy-queue".
22:23:10
no-defun-allowed
now cl-speedy-queue has been loaded, so you can probably use the library from the package cl-speedy-queue (or check which packages are loaded in the printout)
22:24:13
no-defun-allowed
but basically you need to prefix the library's function names with cl-speedy-queue:
22:24:35
no-defun-allowed
eg if my library has the function FROBICATE i might write (my-library:frobicate thing)
22:25:15
neeasade
can I alias things -- eg something like cl-speedy-queue -> csq, so I can (csq:function) ?
22:26:44
no-defun-allowed
package local nicknames are on their way to being implemented in modern CL implementations, so come back in a few months
22:27:07
no-defun-allowed
but if you're lucky, the author may have picked one since that's quite a long name
22:31:40
no-defun-allowed
drmeister: Probably a bogus guess, but it seems ECL uses the Boehm-Weiser collector from the documentation
23:25:29
drmeister
Thank you - I know about ECL's garbage collection - I wonder if they managed to get code put under control of the GC.
23:41:35
no-defun-allowed
Judging by https://common-lisp.net/project/ecl/static/manual/ch34s06.html, the feature name suggests ECL uses dlopen which probably would not allow for that to happen.
0:01:29
aeth
How do people generally structure their conditions? Would it make sense to have them in one central file to simplify the flow of things in case they're later needed elsewhere, or do people generally put them in the file that they are designed for, if they're only currently used in one place?
0:11:50
splittist
aeth: one possible benefit of putting them all in the same file is that you can abstract common functionality into 'internal' functions. Of course, source files are either an awful mechanism, or irrelevant in the face of M-. and friends, depending on my mood (:
1:33:08
pjb
aeth: conditions are classes (and with multiple-inheritance too) and you will have whole hierarchies of conditions just like you have hierarchies of normal classes. You would organize them the same way.
1:33:42
pjb
aeth: in CL, you're free to organize things as you wish, you're not constrained by equivalences such as class = namespace etc.