freenode/#lisp - IRC Chatlog
Search
12:02:02
VincentVega
So, I have a problem where a metaclass-based MOP errors out with certain inheritence conditions (B inherits from A and contains an error which happens during inheritence finalization), but then when I redefine B correctly, trying to reevaluate definition of A yields the error again (even after redefining B correctly). This is annoying, and I have
12:02:02
VincentVega
no clue what to do about it, other than restart the image. I tried makunbound on all classes and doing the finalization, but nothing. Any ideas how this may be treated? PS It's like this on CCL and ECL, but SBCL is just fine.
13:32:15
shka_
question: is package (global) nickname is effectively the same as the package name or there is the use case where nickname can't be used
13:36:43
specbot
Package Names and Nicknames: http://www.lispworks.com/reference/HyperSpec/Body/11_aaa.htm
14:36:22
pyc
is there any possible reason (ensure-directories-exist "foo/bar/" :verbose t) will not create directories when I execute my program through SLIME but will create directories when I am doing so on the shell via sbcl --script program.lisp?
14:38:26
Nilby
I would guess your working directory in the SLIME lisp might be different than you think.
14:38:43
pyc
I got a clue. While executing through slime, it is creating the directory at ~/foo/bar/ (not my current directory).
14:39:30
pyc
now the problem is that (uiop:getcwd) in SLIME shows ~/workspace as SLIME's current directory. Still (ensure-directories-exist "foo/bar/" :verbose t) is creating the folders at ~/foo/bar/. Why isn't it creating them at ~/workspace/foo/bar/?
14:41:27
pyc
Nilby: you are right. *default-pathname-defaults* shows my home directory. Do all CLHS file functions default to that?
14:41:39
Nilby
*default-pathname-defaults* is where lisp file functions will work, and getcwd is where lower level os things will default to
14:42:13
pyc
it gets confusing because `uiop:delete-directory-tree` defaults to current directory but `ensure-directories-exist` defaults to home directory.
14:42:56
pyc
It looks like as a best practice I should then use absolute paths everywhere by concatenating (uiop:getcwd) myself to all paths I need to work with?
14:43:28
Nilby
It's terribly confusing. I use a change-directory function or with-directory which always sets both.
14:46:13
Nilby
When I first started using CL it drove me crazy. Then I wrote my own things which are always consistent.
14:48:43
Nilby
It's probably best to use the normal idiomatic things, and test any file operations thoroughly.
14:53:59
Nilby
I'm probably not the person to ask. But I notice the excellent quicklisp software uses the standard CL functions and carefully gets it right, but adjusts for portability with #+
14:57:58
Nilby
I'm not looking at anything specific, but most stuff in the ~/quicklisp/quicklisp/ directory, does a lot of file and directory operations.
15:01:53
Nilby
but I should probably refrain from giving advice, since I rarely do things the recommended way
15:04:31
pyc
thanks Nilby for sharing your knowledge so far. This fact about *default-pathname-defaults* was eye opening for me.
15:34:23
Josh_2
Well I just watched a video of a tortoise beating a hare in a straight line race ¯\_(ツ)_/¯
16:11:31
pyc
Why is it named *default-pathname-defaults*? What is the significance of 'default' on both sides of the name? also why 'defaults' (plural) in the end when all it contains is a single path value?
16:17:30
pyc
Is there something in CLHS to (1) copy file (2) copy directory recursively? Or do I need to take a look at uiop for it?
16:23:52
TMA
pyc: pathname has several components (version, type, ...) and the values of those components in the value of *default-pathname-defaults* provide the defaults
16:36:39
Nilby
:defaults is keyword argument to make-pathname, which sets the default values for the components. *default-pathname-defaults* is effectively the default value of the :default keyword the make-pathname. It's plural because it specifies the defaults for the multiple components of the pathname, like host, device, etc. The idea that it should work on things like VMS, TOPS-20, Unix, DOS, LispM, etc. is why it's so crazy.
16:40:42
Nilby
It's like a URL before URLs were invented, but that sadly can't fully capture URL syntax now, and leaves a lot of flexibility to be inconsistent.
17:35:48
holycow
i'm trying to consume data from a text file, stuff it into a plist and do some lookups as per the gigamonkeys common lisp book.
17:36:27
holycow
however, after i consume the data, even though the plist seems properly formatted, getf complains about a malformed property list
17:37:27
holycow
can someone give me a clue what I am doing wrong here? the plist list of lists ((list1)(list2)(list3)) seems fine on visual inspection
17:38:00
holycow
i did catch that it didn't like empty new lines in a text file, but that means i should do some text pre-processing before stuffing the data into a plist
17:41:10
holycow
splittist:: total noob here, not sure what that means. the plist format looks the same to me as the gigamonkeys example of ((list1)(list2)(etc))
17:48:49
splittist
Xach: if only it was new code, instead of breaking out stuff I'd written before. But - Thanks!
20:12:30
_death
pyc: there are a many of choices you need to make when you want to "copy a directory".. but here's a barebones function https://gist.github.com/death/2b7b1cfe6a38fc4b368ba91419c75e2e
20:16:26
_death
pyc: not that I'm aware of.. like I said, there are many choices to make, so a general solution would be a function with lots of options of a library for building such an operation
20:23:32
yuan
I'm not sure how to investigate, (bt:all-threads) gives me a list of threads but I don't know how to see what each are doing.
20:28:51
_death
so it waits for a line from the stream.. I guess hunchentoot or you can set up a timeout
20:29:39
juliusdeane
I'm able to call printf and flush to get output when running sbcl from the command-line
20:55:05
_death
hunchentoot's acceptor has timeout initargs.. it calls a set-timeouts function in accept-connections, prior to calling handle-incoming-connection, which in turn creates a thread and eventually calls process-connection, which calls get-request-data, which calls read-initial-request-line..
20:59:42
_death
well, maybe it doesn't even try to read from the socket, just waits until it's readable
21:11:36
_death
maybe make-ssl-server-stream should pass a :deadline initarg with value derived from the stream it wraps
21:20:01
_death
to try, you can call (setf cl+ssl::ssl-stream-deadline) in an :around method for initialize-connection-stream ..
21:23:28
yuan
Ok, I set the deadline attribute, restarted and can't see that thread anymore, I think that's it
21:26:58
_death
I guess not many stumble on this code path.. for example, I use hunchentoot for years, but with nginx frontending, so no need for ssl acceptor
21:28:18
yuan
I see, I really don't know much about web and just want to simple server for my blog so I just put everything into hunchentoot
21:30:10
_death
hunchentoot documentation hints at it at https://edicl.github.io/hunchentoot/#proxy but should likely be improved