freenode/#lisp - IRC Chatlog
Search
10:43:15
minion
why Lisp: The first chapter of Practical Common Lisp: http://www.gigamonkeys.com/book/introduction-why-lisp.html
10:46:47
Younder
I take it from flip214 that I need to speak perfectly conceptually clear. And I rely on the spell checker because a simple comma can label me as an idiot,'
10:47:59
Younder
I take it from flip214 that I need to speak perfectly conceptually clear. And if I rely on the spell checker because of a simple comma can label you can still me as an idiot.
11:12:28
myrkraverk
The colon in question is inside " "s, so I really don't understand the error message.
11:20:42
Younder
Whatever, on a remote terminal, vim with syntasic is just about the best you can get.
11:26:42
Shinmera
Tramp is basically just an mode for emacs that copies the file in the back through SSH when you save/load.
11:34:44
solene
I'm displaying text in a terminal and I would like to continue scrolling using #\Space
11:38:32
myrkraverk
When I do (coerce 'simple-string foo) ; where foo is (vector character 40) why do I get: SIMPLE-BASE-STRING can't be converted to type (VECTOR CHARACTER 40) ?
11:40:01
jackdaniel
also, simple-base-string has base-char elements, while there is no guarantee, that character is a base-char
11:40:31
myrkraverk
The function I'm trying to feed this accepts simple-string and simple-base-string.
11:45:11
Younder
you might wanna look at: https://github.com/sbcl/sbcl/blob/master/src/code/reader.lisp
11:47:27
myrkraverk
Such as custom looping through the vector to create a simple-string, or something.
11:52:21
pjb
solene: if you insist on SPC, have a look at implementation specific features such as #+clisp ext:with-keyboard, or at cl-charms (ncurses).
11:52:32
solene
pjb, I would like to be able to use both, I use get-char now and it works well with RET (it's also possible to type others characters in my software)
11:52:55
solene
I think I'm going with a little of C code, I already have an external C library so most of the work is already there
11:54:04
pjb
You may also use termios, with cffi, but I'd be weary of changing the characteristics of the file descriptor under CL streams.
12:24:27
jackdaniel
pjb: cffi = calling foreign code, that's all. You don't have to touch C to use functions using this calling convention
13:04:48
pjb
jackdaniel: cffi has all the disadvantage of the C code compiled with the C compilers requiring cffi.
13:51:59
logicmoo
macro-function lambda lists are always (form env) .. but not (&whole form env) .. right?
13:54:52
pjb
It then uses destructuring-bind to split it into the macro lambda list (minus &env which is processed by defmacro and passed as the env argument).
13:56:45
logicmoo
this leads me to another question (barely related) nut since you mentioned the destructing-bind was wondering if documentation strings would be left over inside the stored form
13:58:27
pjb
destructuring-bind doesn't take a docstring, but it take declarations. Since declarations may occur after the docstring, it would break if it was left.
13:59:46
pjb
Notice that it all relies on defmacro, which is what is specified. Your defmacro could very well generate the macro-function differently, not using destructuring-bind.
14:00:26
pjb
But if you assume it, then this gives constraints on defmacro, such as the handling of &env, of the docstring, and of any declaration concerning the &env parameter.
14:02:17
logicmoo
i neglected to also synthsize the macro-function though so making sure its proper as one might expect to (macro-function 'symbol)
14:02:41
pjb
(defmacro foo (abc &env *env*) (declare (integer abc) (dynamic-extend *env*) (special *env*)) (foo* abc (g env)))
15:07:42
drmeister
Hey lispers - Xach told me a few weeks ago about a mechanism in quicklisp to bundle systems for deployment. I'm trying to jog my memory - does anyone know about a quicklisp facility for bundling systems?
15:13:45
drmeister
Ok - that's ok - my end goal is to construct a monolithic fasl that contains code from several quicklisp systems, several quicklisp systems that are in my local-projects and several asdf systems that are provided by my source code.
15:15:14
drmeister
Along the way I need a list of source files that will serve as dependencies for the build system that will build this monolithic fasl.
15:17:26
drmeister
Currently I use (ql:quickload "main-system-with-many-dependencies") to find all of the asdf .asd files in quicklisp/local-projects and quicklisp/dists/quicklisp/software so that I can grovel the "main-system-with-many-dependencies" to build this list of common lisp files that will be the dependencies of the monolithic fasl.
15:19:46
drmeister
Is there a way to get quicklisp to find and load all of the .asd files but not compile everything?
15:24:22
drmeister
Sorry if this sounds a bit confused - I'm a bit off the map here - trying to figure out how to properly merge building a monolithic fasl file with our 'waf' build system (written in Python) and get waf to know the dependencies of the monolithic fasl file.
15:24:28
dmiles
is it acceptable practice to store important parts of the implementation things in the symbol-plist or should it be kept clear for users?
15:28:38
dmiles
implementation package makes sense .. i was thinking about though as i am loading a file.. for things like warnings
15:36:23
dmiles
it transplies the bodys to prolog.. then uses the internal compiler of prolog to make tramploines
15:38:32
dmiles
but i also expect macroredefinations and want ot keep there sources arround so i can recmpile as needed
15:40:41
dmiles
for exmaple my symbol-function accessor lets them supply an env so they can peer into the flets
15:41:29
thebigj
Friends, I am trying to understand https://dpaste.de/ZRvU/raw this sample common lisp code given as the example in Aspected Oriented Programming ECOOP'97
15:41:54
thebigj
From https://en.wikipedia.org/wiki/Common_Lisp#Syntax I can understand first line is defining a function named or!
15:42:29
beach
thebigj: How come you need to understand Common Lisp code if you hve no experience with it?
15:43:24
thebigj
beach: I have experience with programming. If someone can explain in words I will be able to catch them and understand what the code does.
15:45:01
beach
If the image A has a non-nil pixel in it, then that pixel is copied into the image RESULT, otherwise the pixel in image B is copied.
15:45:45
beach
The code is also badly indented, and the naming is bad. We don't use the SET- and GET- prefixes much.
15:46:02
dmiles
btw i finnaly letting the compiler write the functions for me .. (instead of by hand).. here is one it write: https://github.com/TeamSPoon/wam_common_lisp/blob/master/prolog/wam_cl/places.pl#L20-L52
15:48:23
beach
thebigj: I still don't understand why you need to understand Common Lisp code when you have no experience with it. Are you trying to learn Common Lisp? If so, it is probably better to read a book.
15:51:56
_death
OR is a weird operator to use in that context, maybe it should be LOGIOR.. and then, you'd want to generalize it so that it'll be (combine image1 image2 #'logior)
15:52:52
_death
and then you'd likely want to be able to pass a result image rather than creating a new one
15:53:18
Bike
Right. Well, the code is ORing two images together in an explicit nested loop like beach said. It's not great code as everybody said, but that's the gist
15:59:15
dmiles
beach: i dont suggest trying it now but here is what was working a few days ago: https://github.com/TeamSPoon/wam_common_lisp/blob/master/README.md#howtoquickstart
16:30:42
beach
dmiles: I do not use Prolog, so I'll be interested in your implementation only if it has some advantages over what I currently use. Sorry about that.
16:32:50
beach
dmiles: Interested in using it, that is. I might be interested in implementation strategies.
16:35:40
dmiles
i used a prolog atom (it is a special interned object that acts like aprimary key in the database) .. i record its superclasses and that is it. i lazily create prolog fields in the 'asserta database' as they are either first read or set
16:38:40
dmiles
if someone adds a cons to a field.. i have to create an area that is tracked and modifiable
16:38:42
beach
By "standard instance" I meant an instance of a standard class, and not necessarily a class.
16:39:26
dmiles
i meant an instnace .. except i should have not siad superclass.. i should have said one of more classes it is an instance of
16:40:47
beach
But, again, why does it matter what you store in a slot? Why is storing a CONS different from storing, say, a symbol?
16:43:45
beach
I am sorry, this is not working. For every question I ask, your answer introduces at least one new term I don't understand.
16:44:00
dmiles
(let ((x (cons 1 2))) (setf (slot-value ....) x)) that slot gets created on first use .. in live memory
16:46:22
dmiles
until a the slot is needed .. at which time i confirm on the class metaobject the slot is even valid
16:47:52
beach
I still don't understand why there is a difference in what happens in the standard object (call it obj) when you do (let ((x (cons 1 2))) (setf (slot-value obj ...) x)) compared to (let ((x 'a)) (setf (slot-value obj ...) x))
16:47:54
dmiles
this though wasnt a premature optimazion (though it would sound like one) it is that it is to allow a non determistic deductive system
16:49:20
dmiles
whay it maters if it is a cons or array vs a constant because constants are all identically idetified
16:50:27
beach
And, how are you using the word "constant" here? Certainly not the way it is used in Common Lisp.
16:52:10
beach
(let ((x (cons 1 2))) (setf (slot-value obj ...) x) (eq x (slot-value obj ...))) => True
16:55:27
beach
OK, let's do this instead (defun ff (x) (setf (slot-value obj ...) x)). Does it matter what type X is what happens in the (setf slot-value)?
16:55:48
dmiles
Objects are all inert pictures as well.. so to put something modifiable in it.. i have to make sure i can modify it later without modifying the object
16:58:30
beach
So, suppose the function above was called like this one time (ff (cons 1 2)) and like this another time (ff '(1 . 2)).
16:59:46
beach
The result of evaluating (cons 1 2) is mutable, but the result of evaluating '(1 . 2) is not.
17:00:36
beach
About half an hour I asked whether the (setf slot-value) behaves differently if it is a CONS and if it is a symbol, and you said yes.
17:01:20
beach
I don't think I'll ever understand what you are saying, so for now, I have to give up. Sorry.
17:02:13
beach
You might want to make sure you use standard terminology if you want people to understand what you are doing.
17:05:16
dmiles
worse yet, i try (though not even doing that good a job of it) trying to use more C terminology than prolgo since people have more experience in talking about Lisp in C languages
17:06:54
dmiles
as far as what my implementation does in general is acts very lazy so i pay penalities at JIT compiler time
17:10:58
dmiles
there are many optizations that work on the warren abstract machine (wam-cl) that dont work so great on conventional machines .. the warren abstract machine was created to do things lisp coders where doing at the time with expert system
17:14:04
Bike
it seems like you're talking about basic semantics rather than optimizations. and like, "levels", "neutral", none of those are lisp terms or c terms.
17:17:20
dmiles
setf after its ben resolved to call something, will call something that will have several levles
17:21:24
dmiles
Bike: if it creates a frame than sure i suppose it could be a a differnt level especially if we have differnt shadow bindings in each c1 (even if TC)
17:22:55
dmiles
a shadow binding is where a dynamic symbol has a value that changes durring child frames
17:33:53
dmiles
the problem with the term lexical binding is it is used to not biding both dynamic and non-dynamic variables
17:38:36
beach
drmeister: You REALLY need to make sure you use standard terminology, or else you won't be understood. And people might lose interest, the way I did.
17:39:53
dmiles
i doubt my answering of questions will be helpfull as i may not be able to answer them in the terminaolgy desired
17:41:41
beach
dmiles: But, you see, if you don't even know the terminology of Common Lisp semantics, your discourse will make some of us doubt that you are capable of implementing the language at all.
17:46:14
beach
I think it has to do with my training as an engineer, where every word may have some technical meaning.
17:53:59
dmiles
when answering questions about how i instance a standard object, i assumed it is becasue it was hard to think aobut in a language that doesnt have mutability or objects being able to do so, so i was trying to answer why it wasnt impossible to do in prolog.. thus the hacks and inventions
18:00:13
beach
It is safest to assume that the people you are talking to here have very little knowledge about Prolog, especially modern implementations of it.
18:13:00
stylewarning
Hey all, is there documentation anywhere about statically linked C libraries with SBCL/CFFI?
18:25:15
stylewarning
This is so vague to me: https://common-lisp.net/project/cffi/manual/cffi-manual.html#Static-Linking
18:32:19
stylewarning
I see slides, I see reference in the CFFI manual. Of course, in usual Lisp tradition, no comprehensive docs, no examples, no warnings, etc.
18:36:26
Shinmera
If you people knew just how much undocumented, incomprehensible source was out there in other languages...
18:45:40
stylewarning
When I use static-program-op, I get some business about "undefined symbol _main"
18:50:14
stylewarning
Found Fare's static example: https://github.com/fare/workout-timer/blob/master/workout-timer.asd
19:04:45
jeosol
CLOS design question here. What is the better way (for maintainability) to combine two methods defined on two classes A and B, with B inheriting from A. I normally add :before qualifiers to the method with A's object and then just call the method on B, which is the primary method. I have cases where the defmethod on A is called in B using (call-next-method) (this does not use :before tag on defmethod on B).
19:05:57
jeosol
typo correction: in the latter, I mean't (this does not use :before qualifier on defmethod on A
19:07:20
jeosol
I am asking to the general forum. It's more of a design consideration. I normally use the option adding :before to the defmethod on the base class, but have seen codes with call-next-method obviously to handle some specially cases down the line
19:08:09
beach
I don't think there is a general answer to your question. The right answer has to do with the protocol that you are designing. Specifically how you describe the role of the primary method(s).
19:10:06
rpg
Also, notice that :BEFORE methods are really only done for side-effects, since they don't change what the primary method computes.
19:10:41
rpg
... and they can't establish a context for computation necessarily because they are not scoped *around* the primary method.
19:10:57
jeosol
In that case, in my case, the method on the base class only sets up things for A, so I think it's better to use :before qualifier and rely on the standard method combination
19:11:23
jeosol
Yes, I have read that book. I also recently read Andreas compilation and have seen different paradigms used
19:11:45
beach
jeosol: I for one find it hard to find typical use cases from such a general description. But you are probably right.
19:12:22
jeosol
I do understand how CLOS works, I am just concerned about what makes for better code down the line if I get another developer. The organization of class hierarchy is in my head and the code base is getting fairly large
19:13:13
jeosol
thanks for the comments guys, I think it's better to use the :before qualifier on the base class.
19:13:21
beach
I understand, and (again) I think the answer depends on the real meaning of the operations in your protocol, and that no general answer exists for all the cases that fit your description.
19:14:25
jeosol
The book I was referring to was Objected Oriented Programming: The Clos Perspective Edited by Andreas Paepcke
19:18:07
jeosol
Chapters 1, and 2 are very good, respectively Introduction to CLOS and CLOS in Context.
19:19:41
stylewarning
rpg: Do you have some insight as to what this operation actually allows one to do: https://common-lisp.net/project/cffi/manual/html_node/Static-Linking.html
19:20:29
jeosol
Apologies for not being specific enough. Those are the names of the first two chapters.
19:20:53
rme
I always say "Keene", because I can't ever remember if it's "Sonya" (in the text and on the copyright page), "Sonja" (on the cover), or "Sonia" (just another spelling).
19:23:54
jeosol
I think so too, it's a great book. I like it a lot especially the application of CLOS in real applications.
19:25:19
rpg
stylewarning: Not as well as I should: I don't really use the bundle operations myself, and they were added to ASDF without much participation on my part. One thing I do know, though, is that moving images for some lisp implementations from one location to another can fail as they encounter local dynamic libraries that differ from what they "expect."
19:27:29
rpg
stylewarning: But to be honest, I don't know if this problem can occur even without FFI -- I.e., we can dump an image onto a lisp that is sitting on an operating system that has different libraries, providing different entry points to the lisp implementation itself.
19:28:43
rpg
I have decidedly mixed feeling about ASDF's mission-creep from loading systems to providing delivery solution. I believe ASDF kind of slipped into this as it tried to accommodate "compile-to-C" approaches to CL (notably ECL).
19:29:19
stylewarning
s what it seems. Then again, a robust and flexible solution across all implementations seems nice.
19:29:57
stylewarning
I myself am going through a lot of effort right now to make a command-line program faster to start/stop, and it seems like a major bottleneck is the dlopen-ing of 4 libraries.
19:30:51
rpg
stylewarning: So this is for working with FFI? Or is it just a slowdown when the lisp implementation itself is starting?
19:34:06
rpg
stylewarning: then this operation might work for you. You might well get a more portable application out of it, too.
19:34:53
stylewarning
I'm fighting to get it to work. I'm getting some issue where it says it can't find _main when doing some linker operation with "static-runtime_XXXX"
19:44:41
rpg
stylewarning: I'm afraid I don't know that much about the internals of SBCL. But this looks like a problem with CFFI, I think. Not sure why it's looking for main, or who's doing it. Do you have some kind of backtrace for this?
19:53:24
rpg
are you sure that "make" maps to the operation you expect? Looks like it should. But just in case -- you're also testing with (oos 'static-program-op "static-fire/static")
19:54:11
stylewarning
rpg: I'm fairly certain make is doing what it should because it's calling the linker. But yes, in that case, using oos results in the same failure.
19:55:19
stylewarning
I poked around in the source and it seemed like MacOS was supported (mostly through the #+bsd feature)
19:58:14
stylewarning
rpg: Further hint: On Linux, at least `make` returned T; not sure if/where it wrote to.
19:58:18
rpg
stylewarning: I just don't know what compilers support compiling to .o instead of .dylib on that platform.
19:59:21
rpg
stylewarning: on linux you should go and root around in the .cache to see if you can find the compiled output. There's some way to redirect the output, but it's not very tasty (IMO), again because of the extension from fasl-building to executable-building.
20:06:08
fourier
whats the easiest way to compare 2 class instances which has only numeric slots without manually comparing slots ? iterate over slots using MOP and compare them?
20:14:45
stylewarning
Is it too hard to write (with-slots ... (with slots ... (and (= a-1 b-1) (= a-2 b-2) ...)))?
20:19:28
shka
fourier: if those are just numbers, stick all of those into vector and use vector= from alexandria
20:20:09
Bike
It's easy. You have (defclass foo ...). You write (defun foo= (foo1 foo2) (and (= (foo-a foo1) (foo-a foo2)) (= (foo-b foo1) (foo-b foo2)) ...))
20:20:47
fourier
problem is what i dont know accessors/fields. the struct is generated by cffi's define-c-struct-wrapper
20:22:43
Bike
I mean, defcstruct doesn't even make a lisp class you instantiate lisp objects of, does it?
20:29:58
Bike
This seems to define a CL class that mirrors a C struct and can be initialized with one (but thereafter loses any connection to any C object)
20:33:06
fourier
another question though. is elsconf mailing list dead now or I'm not properly subscribed (resubbed with another email) ?
20:38:54
rumbler31
what was that thing about specifying symbols that are not interned? like if you wanted to ql a package and you didn't want the name you provided to be interned as a symbol. I'm not sure what to google for that
20:39:26
Bike
though i think for quicklisp they're string designators, so you could just throw it a string.
20:40:40
rme
fourier: I don't think there's been any traffic on the ELS mailing list. According to the list archives, the most recent message was sent on November 29th.
20:43:48
Bike
rumbler31: i think quickload is a normal function, so it evaluates its argument (and #:quickproject is an unbound symbol)
20:44:42
rumbler31
I could have sworn that this #: was discussed in the context of quickloading before but
20:46:20
rumbler31
so the reader reads #:quickproject, doesn't intern it, it gets passed to quickload as (quote quickproject)
20:55:54
Bike
it's nothing special. it's like if you wrote (ql:quickload oiwjefoansd). oiwjefoansd is unbound, so no good