libera/#clasp - IRC Chatlog
Search
10:30:29
Colleen
yitzi: drmeister said 7 hours, 21 minutes ago: - I may have uncovered a bug in your LOOP macro? Or a bug in a system called :CHUNGA that Hunchentoot relies on. Claude monkey patched a function and now Huntchentoot appears to work.
10:32:05
drmeister
I'm not sure there's actually a problem. I was moving pretty fast last night trying to get hunchentoot working in Cando and that came up.
10:32:27
yitzi
The initial values of all LOOP variables in the spec is unspecified. SBCL is MIT LOOP as is most CL implementations.
10:33:43
drmeister
Ok - and sbcl uses MIT LOOP and chunga has an implementation specific bug according to the clhs?
10:33:53
yitzi
Khazern initializes LOOP variables to default values and only sets them to step values if the LOOP actually runs.
10:35:27
yitzi
For example, (LOOP FOR I OF-TYPE INTEGER IN '() FINALLY (RETURN I)) in Khazern returns 0 even though the LOOP never runs cause I is an integer.
10:36:26
yitzi
But for your example, the loop variable has an implied type of INTEGER and since the LOOP doesn't run the default value of INTEGER is 0.
10:37:50
yitzi
To me a loop of (LOOP FOR I DOWNFROM 0 TO 0 ...) implies that value is I is in the interval [0.0]
10:38:35
yitzi
And (LOOP FOR I DOWNFROM -1 TO -1 ...) implies that the value of I is in the interval [-1.-1]
10:40:06
yitzi
So I've made that change to Khazern and Clasp has PR https://github.com/clasp-developers/clasp/pull/1759
10:41:17
yitzi
On a side note. I think that is stuff in Clasp or Cando that you haven't pushed. https://p.blueridgedebate.com/?fc7256b76cc049d9#F4N39eZYcRzwbpUVy9N1LrfK8N4jCqBzaLxVkSpfx7pB
11:17:32
drmeister
I think everything is pushed and it builds on my system. If that problem persists then I'll have to dig deeper.
11:37:54
yitzi
I am suspicious about that :external-format change. :default is actually the default external-format. Not NIL.
11:39:47
yitzi
I think that sockets.lisp is correct, but our C code is probably doing something wrong with :external-format :default.
11:43:35
yitzi
bike: we have low-level bivalent streams. I added them a while back. All you have to do is change the stream element type, via (setf (stream-element-type stream) 'integer) or (setf (stream-element-type stream) 'character)
11:47:18
yitzi
I suspect that hunchentoot is just assuming you can do whatever you want without explicitly switching. Which wouldn't make a lot sense since in the case of character streams you also need the external-format to decide on the octet encoding.
11:48:18
yitzi
The element-type and external-format are a pair that determines the reading & writing in other words.