freenode/#lisp - IRC Chatlog
Search
11:44:54
#lisp
** TOPIC Common Lisp, the #1=(programmable . #1#) programming language <http://cliki.net/> <http://paste.lisp.org/new> logs:<http://ccl.clozure.com/irc-logs/lisp/>|contact op if muted|SBCL 1.3.7, ASDF 3.1.7, ECL 16.1.2, CMUCL 21a, CFFI 0.16.0, cl-launch 4.1.4, flexi-streams 1.0.15, Hunchentoot 1.2.34, Drakma 2.0.1
13:03:39
rudi
the aim was to change as little as possible in aserve itself, and do everything with a magic compatibility library
13:04:18
Xach
I am old and doing the same thing! But I am going all out and trying to change not one line of franz's aserve.
13:04:30
rudi
these days aserve would live as a git branch with continuous merging against upstream, of course
13:04:40
Xach
(Sending in some pull requests to change things that are pretty hard to emulate, though...)
13:06:49
rudi
um, what’s the name of the condition where you assume every unfamiliar word refers to some new hip project / website?
13:07:18
rudi
(the steamship patch delivery service? never heard of it, god I’m behind the times etc)
13:10:22
rudi
what’s the reason for the sudden aserve interest? Keeping PCL chapters alive, or a general bout of hackishness
13:11:23
Xach
Got a project that could benefit from catching up to latest aserve. The portable aserve split was a long time ago.
13:21:54
Xach
What's the easiest way to start a slime session with some code loaded and in a particular package (defined by the code that was loaded)? slime-lisp-implementations hackery?
13:30:51
jurov
Xach: That would interest me, too. So far only way I got it was to externally run the lisp, loading script that sets it all up, and in the end
13:34:57
jurov
maybe i did something wrong, but only when i connected remotely and only with that communication-style, it kept the package as I set it up.
14:25:16
flip214
With 1.3.11 the form "(list 1 #+nil )" gives me "unmatched close parenthesis", which is ... unexpected? "missing form" or "missing closing parenthesis" I would understand
14:31:50
Xach
flip214: it can ignore a lot of invalid syntax, but not every possible invalid syntax.
14:32:36
Xach
you wouldn't get a missing close paren - READ won't return until it's there. you could get an EOF though.
14:40:48
flip214
Xach: I'm wondering about the message. the reader could say "missing expression after #+" or so.
14:45:05
Xach
flip214: No. I said that the reader must still read the expression past #- or #+ in order to ignore or include it. And while it can skip certain kinds of invalid syntax, it can't skip an expression that starts with a close-paren.
14:46:24
flip214
ah okay, now I understand. #+ reads another form, and that one starts with ")", so returns that error.
16:11:47
malice`
Hi! I'm trying to parse html site. I've used chtml so far(chtml-matcher). However, when parsing some site I get an error about "invalid uri for prefix xmlns". Any ideas how can I get around it, or good replacement of the lib I'm using?
16:13:41
PuercoPop
malice`: if you are trying to scrape a website lquery is more when parsing the dom (uses plump) and has a nicer interface for doing use imho (css selectors)
16:20:51
fendral
it should be entering the if when it reachs the 3rd element in the list since B was already in my hash table but it doesnt
16:29:36
dlowe
fendral: append returns the appended list, so you'll need to use setf if you want to actually change the value of the variable
16:40:37
dwc
mykon_: http://ctags.sourceforge.net/languages.html shows "Lisp" as supported. Never tried it myself
16:43:01
beach
fendral: [reading the logs] You need to indent your code properly. If you had used the indentation contribution of SLIME, you would have seen the problem.
16:44:03
beach
fendral: Then all by the first DO clauses in the last block would have been aligned under the ELSE and you would have seen that they are not covered by the condition.
16:50:10
fendral
i see, i was writing the code in a different editor so i guess it didn't indent properly
16:50:11
jasom
Is there a way for asd files to include other files; would just an (eval-when (...) (load ...)) work?
16:51:50
beach
fendral: You can of course use any editor you like, but you should make sure it can indent your code properly. It is impolite to submit badly indented code for others to read, because you then force them to count parentheses, whereas Common Lisp programmers rely on indentation to understand the structure of the code.
16:55:01
jasom
fendral: https://github.com/ds26gte/scmindent has lisp, racket and javascript programs that can indent lisp code to a reasonable degree
16:57:01
malice`
How can I get link from element A from plump? I have vector of PLUMP-DOM:ELEMENT a; I can extract text with #'lquery-funcs:text , but idk about link
16:57:29
jasom
beach: I don't; emacs+slime is clearly the right solution, but asking someone to switch editors at the same time they are learning lisp may be a bridge too far.
16:57:35
jcowan
I find that the best way to indent Lisp code for publication is with Emacs, even though I don't use Emacs
17:06:52
Bike
if manrdb:defmmclass looks like it looks like it does, that will define a class named 'x'
17:10:02
Bike
depends on what manardb has to let you define classes. there migh t be an ensure-class equivalent.
17:14:11
malice`
One more question; if I get link from href, it's sometimes relative(without base, e.g. without "http://www.google.com/". Is there some function to compose that for me? I know about Python's urlparse.urljoin
17:22:49
Dan1973`
to be honest on editors and programming, I would much more prefer to use a proper IDE (and by proper IDE I mean something like MS Visual Studio, not Eclipse bloat) than a frankensteined blob of text editors, plugins, unix tools and whatever else. IMO Emacs is an enduring testimony of how much a ppl working on Unixes need a proper IDEs. It was coerced into being Lisp IDE, C/C++ IDE, SML IDE ... and whatnot. Most of the programmers *I*
17:22:50
Dan1973`
seen (ymmv) using emacs in current time just tried to reinvent the wheel in Emacs and build themselves yet another IDE
17:35:53
DeadTrickster
thanks for replies guys, Actually it's a very first time the system at least builds after dist update :-). yay!
17:36:48
DeadTrickster
will play a little bit more and hopefully local-projects overrides cleanup will follow
17:56:08
akkad
wow. manardb works great in a repl. but when compiled just segfaults on every implementation
17:56:11
PuercoPop
_death: but there are alternatives that don't have bugs? puri is barely maintained and doesn't handle unicode, there is a puri.unicode fork but it is not on quicklisp
18:07:20
akkad
ccl: Error: The value #<A Dead Mac Pointer> is not of the expected type MACPTR. sbcl: Memory fault at 0x7ffff7fde000 (pc=0x10035b0d70, sp=0x7fff9fb17658) lispworks: Error: Segmentation violation(11) [code 0] at 40D0E59E64 {Offset 48 inside #<Function MANARDB::MTAGMAP-WORD 40D0E59E34>} allegro: Received signal number 11 (Segmentation fault)
18:21:59
_death
PuercoPop: not familiar with other alternatives.. puri was sufficient for what I needed
19:51:54
rumbler31
using drakma to post a binary file. when watching wireshark, the drakma-built header is sent along with a truncated version of the file, immediately after the header is sent again and a complete copy of the file is sent
19:54:52
JokesOnYou77
What is the best way to compare the performance time of two functions? I know that there are a couple of different timing functions.
19:56:50
d4ryus
hi, i have 2 packages (lets say A and B) and code inside A needs a class from B, and code inside B needs a class from A. loading it either way (A - B, B - A) gives me a 'There is no class named ...' error. Is there a way to export classes? (or declare?)
19:59:45
JokesOnYou77
I'm trying to replicate the functionality of the %%timit magic from jupyter/ipython. So I'd like to evaluate a function n times and then perform that evaluation m times. The function should brint the best average time per loop iteration achived out of the m experiments.
20:02:01
|3b|
d4ryus: split the code into files that can be loaded interleaved? (assuming you mean CL packages, and not what cl users would call "systems")
20:02:14
akkad
JokesOnYou77: https://gist.github.com/2ecbe1d7cbc243097070127ce5476083 is an example that works on all 4 lisps
20:03:51
|3b|
CL only packages only export "names", independent of anything that might be named by that name, so you can't really export a "class" meaningfully
20:04:47
|3b|
(and "there is no class named ..." means the class doesn't exist yet, assuming the "..." is correct, which is unrelated to package problems)
20:06:44
d4ryus
yes, that was my problem. but i will just put my classes inside a classes.lisp and load that before everything else. should work fine :)
20:06:49
|3b|
other options include one using a base class from the other, or having a package C for one of them (possibly not as a public API), or defining it in one and exporting from the other
20:15:38
JokesOnYou77
|3b|, and so I discover yet another key-combo I didn't even know I had! thank you!
20:16:01
jasom
how is uiop:ensure-absolute-pathname supposed to work? I get an error when passing a relative pathname: (uiop/pathname:ensure-absolute-pathname "foo.txt") "Default pathname NIL is not an absolute pathname"
20:16:54
|3b|
JokesOnYou77: i think slime-completion-at-point-functions is how you select which variant you want to use
20:17:13
jasom
hmm, if I pass *default-pathname-defaults* as the optional parameter, I get something sane; is there a reason this isn't the default behavior?
20:20:11
xqbt
Hi! I have a question. So, say I have a list of plists. Now, with find-if, I find a plist that interests me. Something like (find-if #'(my-pred) list-of-plists). It works just fine. Now, I want to modify this plist that I found. I want to change _several_ of its properties. setf seems to be able to change only one at a time. How do I do it? Please help!
20:23:16
dlowe
xqbt: I think maybe it's time to abandon the plist and use structs or classes instead.
20:23:28
flip214
(let ((my-plist (find-if #'my-pred list-of-plists))) (setf (get :a my-plist) 1 (get :b my-plist) 2 ...))
20:23:29
|3b|
* doesn't know of any way to change multiple properties in a plist aside from just prepending the new keys/values to the list though (aside from just (setf (getf ..) .. (getf .. ).. ...)
20:23:59
|3b|
flip214: watch out for adding a key to the list when you store the result of find-if like that
20:24:09
mood
d4ryus: Note that loading files with interleaved dependencies usually works just fine if the compilation happens inside a `compilation-unit` (which ASDF establishes around a system load, for example).
20:25:01
xqbt
oh, so I just did (defvar newplist foundplist), then changed newplist and the changes showed up in foundplist! After an an hour of experementing! |3b|, I guess that's what you are telling me?
20:26:23
dlowe
xqbt: thinking of an object with slots that can be filled is easier than wrangling plists, to be sure.
20:27:07
|3b|
also, using defvar like that suggests you are doing something odd, though might be OK if you are just messing around in repl
20:28:04
|3b|
but if you store the plist returned by find-if, then add a new keyword, next time you look it up with find-if it won't see the new value
20:30:50
xqbt
|3b|: the keys do exist for sure, but I agree, objects are a worthy abstraction. I just do not understand how the thing I described works, it is like a reference in C++. If I do (defvar x 3) (defvar y x) (setf y 4), the x is still 3. But with plists, its somehow different...
20:31:26
|3b|
xqbt: i wasn't suggesting "objects" though a better abstraction is probably a good idea
20:33:24
|3b|
you store a (reference to a) specific object in the variable, then changes to the contents of that variable are visible from all other references to that object
20:34:44
|3b|
if you change the object stored in the variable (for example if you (setf (getf x ...) ..) and the key doesn't exist), then other references to the original object won't be changed so won't see the new data
20:35:52
|3b|
in CL, most objects are stored as references, with numbers and characters being notable exceptions, since they don't conceptually have "contents" that you could change, so you can only replace them with a different object
20:42:56
xqbt
interesting. Cons, array or list, right? (defvar qq '(1 2 3)) (defvar xx qq) (setq xx '(1 2)) and qq is still '(1 2 3)...
20:47:41
|3b|
xqbt: i mean like (defvar *a* (list 1)) (defvar *b* *a*) (setf (car *b*) 2), (car *a*) is also 2 now
20:49:25
dlowe
xqbt: btw, if you modify quoted lists, your lisp might explode. Use (list 1 2 3 4) to avoid this problem.
20:51:22
|3b|
(and if you aren't aware, be careful using DEFVAR on arbitrary names when you are doing real work. DEFVAR modifies the semantics of /all/ variables with that name, including function parameters and local variables, which is why there is the convention to use ** on names of defvar variable names)
20:52:14
|3b|
* also uses SETF always instead of SETQ, though i'm not sure everyone agrees with that
20:54:42
|3b|
since you can't use that name for locals/parameters at all, while sometimes you want the different semantics of the defvar variables in a local/parameter
20:54:59
dlowe
and it's generally a pain in the butt. I use defparameter with ++ for things I want to be constant
21:03:09
jasom
deliver-asd-op 100% broken on clisp; it generates an .asd file in which the gcc used to build CLISP is on an uncommented line
21:04:13
eschulte1
alexandria has `define-constant' which I like alot, more flexible equality tests.
21:07:47
jasom
well it assumes a whole bunch of things contain no newlines, but that's the one that breaks things
21:10:17
JokesOnYou77
Do I need to update quicklisp regularly? I'm trying to load the random-state library and I'm getting not found. http://quickdocs.org/random-state/
21:33:07
jasom
pipping: which part? I figured out why deliver-asd-op is failing on clisp, and have a workaround
22:20:00
JokesOnYou77
Ok, this is a noob question, but I have a very simple, one file project. This file calls dependencies from quicklisp. Every time I try and compile and load it it can't find the packages from quicklisp. How do I get this thing do load these packages?
22:20:33
Xach
JokesOnYou77: make an .asd file that :depends-on the required projects, and then load the project with asdf or quickload.
22:22:53
Xach
JokesOnYou77: i don't recommend it, but if you stick quickload forms directly in the file, they must be wrapped with an eval-when to take effect in time.
22:24:15
White_Flame
how could you use eval-when to ensure that the symbol & package references in your source to the libraries exist?