freenode/lisp - IRC Chatlog
Search
21:35:22
edgar-rft
himmAllRight17: sorry, but I don't know if it makes sense that you're working on something
21:42:00
aeth
Does #'= behave specially for floats or should floats (almost) never use #'=, like the advice in most languages? The hyperspec doesn't mention it on the = page, so I'm thinking it's the latter, but (1) most implementations might do something that's not in the spec and (2) it might be described in some totally different part of the spec.
21:46:50
Bike
= is numerical equality, which excludes using epsilons or worrying about ulps or anything, basically
21:53:36
|3b|
and 'never use =' isn't really good advice, better "understand what = means for floats"
21:54:26
TruePika
pjb: got atc to wait for a connection now, and requires the DWORD 0x13371157 (Leet List) to proceed...so I'm making progress
22:01:59
TruePika
pjb: I'm testing with socat, which is even stupider than telnet (since there aren't automatic client responses)
22:05:17
TruePika
trying to figure out the simplist way to replace stdin access; I can issue actual keystrokes through the socket that way
22:06:50
aeth
It looks like in SBCL on x86-64 for a simple (= x y) with x, y declared as single-float, there is only one COMISS instruction in the disassembly, which http://ref.x86asm.net/coder64.html says is "Compare Scalar Ordered Single-FP Values and Set EFLAGS", which I think means SBCL can't be doing anything fancy there.
22:07:40
aeth
Interestingly, I think that also means, there's something fancy there for treating 0.0 and -0.0 the same unless COMISS does that.
22:46:11
dim
> Error: Error #<SILENT-EXIT-ERROR #x302000E4982D> While executing: (:INTERNAL MAIN), in process listener(1).
22:48:46
dim
trying to debug pgloader for a user, where it fails fast at startup time without any error message
23:06:30
TruePika
my favorite is in Railroad Tycoon 3, where if you have over 2GB of video memory, the game interprets it as a negative amount and forces the lowest texture quality
0:43:48
rumbler31
drmeister: Do you consider drakma heavy from the user side, or from implementing support for it in clasp?
0:45:04
rumbler31
drmeister: I used drakma to consume multipart http and re-stitch the parts to the full data. Is that what you're dealing with?
0:57:36
trumps_weewee
what's wrong with it? i know something's wrong with it, but i'm tired of trying to figure it out
0:57:54
Moosef
Xach: yeah maybe that question is just me being lazy. A better version/second attempt would be what from the book have you found most helpful?
1:03:25
Moosef
Xach: Cool, I will come back when I have read enough to ask more specific questions. I am really enjoying it so far. Kind of stumbling my way through the General Problem Solver chapter at the moment. It is a humbling experience but I like it.
1:26:04
BusFactor1
How does one get hunchentoot to automatically load an index.html in a directory that's under it's document root?
1:26:38
BusFactor1
I'm pointing it a directories under the root I specified and it doesn't find anything.
1:32:32
Xach
I haven't read the manual in a long time, but I don't remember anything about index.html handling.
1:32:51
Xach
If I had the same question, I'd read the manual again, and if that didn't show anything useful, I'd write a handler.
2:43:50
TruePika
ACTION was confused because there was e.g. READ-CHAR-NO-HANG but no READ-BYTE-NO-HANG
2:46:01
TruePika
ACTION doesn't want to try to rewrite the C side of stuff to use fprintf or sprintf
3:10:20
TruePika
Looks like I might have figured out how to open the socket on the Lisp side of things :D
3:14:34
TruePika
Is there a nice way to ensure that streams stored in an instance get closed when the instance is destroyed?
3:20:43
pillton
I have sometimes used (with-all-my-streams (streams ...) (run ... (make-instance 'foobar :stream (elt streams 0)))).
4:31:47
drmeister
Hey folks - I'm trying to fix broken bootstrapping code and some of it mystifies me.
4:32:08
drmeister
(macroexpand '(setf (class-id class) name)) -> (LET* ((G11279 CLASS)) (MULTIPLE-VALUE-BIND (G11280) NAME (FUNCALL #'(SETF CLASS-ID) G11280 G11279)))
4:37:10
drmeister
Bike: so (macroexpand '(setf (class-id class) name)) should give me the correct expansion for the SETF?
4:37:44
drmeister
Because right after I print the macroexpansion I print #'(setf class-id) and it is #:UNBOUND
4:47:13
drmeister
This is all happening within a (with-early-accessors (+the-standard-class+) ...) macro that sets up a macrolet that defines an accessor for class-id.
4:47:59
drmeister
(get-setf-expansion '(class-id class)) -> ((G11279) (CLASS) (G11280) (FUNCALL #'(SETF CLASS-ID) G11280 G11279) (CLASS-ID G11279))
4:49:37
drmeister
I've added some stuff to with-compilation-unit to track problems with function definitions.
4:50:07
drmeister
This has somehow broken Clasp's bootstrapping - it's a delicate thing to level up from a C++ interpreter to a simple compiler to a full Common Lisp with CLOS.
4:51:20
drmeister
I'm doing macroexpansion on the (setf (class-id class) name) that is causing the problem.
4:51:36
drmeister
The weird thing is that the working version? It shouldn't work according to what I see.
4:51:51
drmeister
(get-setf-expansion '(class-id class)) -> ((G11279) (CLASS) (G11280) (FUNCALL #'(SETF CLASS-ID) G11280 G11279) (CLASS-ID G11279))
4:53:27
drmeister
It's happening inside of a macrolet - can I just evaluate the form? I can check that after evaluation if the value changed.
4:55:05
BusFactor1
I can't believe it's taken me this long to try and find a replacement for python's SimpleHTTPServer in CL still with no success...
4:55:52
BusFactor1
Wookie seems broken, hunchentoot doesn't handle index.html's without writing handlers, s-http-server just doesn't work, woo doesn't come with a file/directory handler...
4:56:15
Bike
so macroexpand is expanding like that because it doesn't know what the hell class-id is
4:58:55
Bike
(macrolet ((class-id (object) (backquote-append ...)) (hack (form &environment e) `',(macroexpand-1 form e))) (hack (setf (class-id class) name)))
5:02:33
Bike
macrolet expands in the global environment by default, but you can pass it an environment object
5:04:08
drmeister
So: (macrolet ((class-id (object) (backquote-append (LIST 'INSTANCE-REF) (LIST OBJECT) (LIST 3) 'NIL)) (hack (form &environment e) `',(macroexpand-1 form e))) (hack (setf (class-id class) name)))
5:06:20
drmeister
And if I put this in the code inside the macrolet that sets up all of these accessors:
5:06:21
drmeister
(debug-boot " (macroexpand-1 '(class-id class)) -> ~a~%" (macrolet ((hack (form &environment e) `',(macroexpand-1 form e))) (hack (setf (class-id class) name))))
5:08:43
drmeister
(macroexpand-1 '(class-id class) ENV) -> (LET* ((G11093 CLASS)) (MULTIPLE-VALUE-BIND (G11094) NAME (INSTANCE-SET G11093 3 G11094)))
5:12:20
drmeister
(macroexpand-1 '(class-id class) ENV) -> (LET* ((G5142 CLASS)) (MULTIPLE-VALUE-BIND (G5143) NAME (FUNCALL #'(SETF INSTANCE-REF) G5143 G5142 3)))
5:13:41
drmeister
Well, this makes a bit more sense. Because in trying to fix the bootstrapping process I decided to try and cut out reloading setf.lsp again.
5:14:13
drmeister
So if the behavior of SETF isn't completely defined - then this sort of thing might happen.
5:17:48
drmeister
So: (debug-boot " (get-setf-expansion '(class-id class) ENV) -> ~a~%" (macrolet ((hack (form &environment e) `',(get-setf-expansion form e))) (hack '(class-id class))))
5:17:57
Bike
"Within the body of macrolet, global setf expander definitions of the names defined by the macrolet do not apply; rather, setf expands the macro form and recursively process the resulting form. "
5:20:01
Bike
if you like, you can do (defmacro cmacroexpand-1 (form &environment e) `',(macroexpand-1 form e)) and skip the macrolet
5:22:21
Bike
get-setf-expansion takes an environment argument the same way macroexpand does, and by default uses the global environment, same way as macroexpand
5:22:58
drmeister
I want to find out where and why the broken bootstrapping code is different from the working code
5:23:54
drmeister
In particular, the broken code fails on: (with-early-accessors (+the-standard-class+) (setf (class-id class) name))
5:27:17
drmeister
I'm going to back up - and go back to the original bootstrapping sequence for bclasp.
5:40:08
drmeister
aclasp defines a few structs with: (defstruct (compiler-message (:type vector)) (prefix "Note") (format +note-format+) message source-pos-info top-level-form form)
5:41:26
drmeister
I use :type vector because before clos is running I can't use defclass and defstruct with CLOS uses defclass.
5:42:40
Bike
this doesn't seem like it should involve anything like class-id, then, seeing as there's no class involved.
5:42:56
drmeister
bclasp is screwing up when it loads the defstruct definition again overtop of the existing one.
5:43:33
drmeister
No - sorry to hit you with whiplash - but I think the class-id issue was because I was avoiding loading this earlier code - that just caused another problem.
5:44:30
drmeister
aclasp loads that defstruct into the interpreter and then compile-file's it and loads it again - that seems to work fine.
5:45:24
drmeister
bclasp loads aclasp (which defines that defstruct) and then compiles and loads the definition AGAIN.
5:50:16
Bike
okay, so it tries to do (subtypep vector (or list vector)), presumably to make sure the defstruct is valid
5:50:19
drmeister
This is a problem that has come up several times that I've tried to improve the bclasp compiler - the bootstrapping always fails on the first defstruct
5:52:30
drmeister
I'm about to put some code in to print debugging messages when I bind a dynamic variable to T
5:53:47
Bike
well, here's a dumb idea: i think that defstruct doesn't take a subtype of vector, it only takes literally vector, list, or (vector some-element-type)
5:57:05
Bike
so more like (or (eq type 'list) (eq type 'vector) (and (consp type) (eq (car type) 'vector)))
5:58:27
drmeister
(#+clasp(or (eq type 'list) (eq type 'vector) (and (consp type) (eq (car type) 'vector))) #+ecl(subtypep type '(OR LIST VECTOR))
6:09:52
drmeister
I wonder though if I shouldn't be looking at the root cause - why 'CONS isn't recognized properly