[Bug-openmcl] file-length
bryan o'connor
bryan-openmcl at lunch.org
Fri Jan 30 22:41:18 MST 2004
i'm sure this won't be the last time file-length gets hacked
for ansi-compliance..
here's my current version based off your changes:
(defun file-length (stream)
(etypecase stream
;; Don't use an OR type here
(file-stream (stream-length stream))
(synonym-stream (file-length
(symbol-value (synonym-stream-symbol stream))))
(broadcast-stream (let* ((last (last-broadcast-stream stream)))
(if last
(file-length last)
0)))))
and the justification:
the recursion is there because i think it's valid for a
synonym-stream to point to a broadcast-stream and a
broadcast-stream to contain synonym-streams.
i didn't want to add any type-checking to stream-length
because it seems fair that it could be useful without the
type restriction.
this also means that stream-length specialized on synonym-
and broadcast-streams doesn't get called any more.
and now the catch:
the ansi-tests file-length.error.7 and file-length.error.8
contradict make-broadcast-stream.5. the ansi spec seems to
contradict itself on this issue also.. i suspect that the
right thing is that make-broadcast-stream.5 is correct and
the result should be 0 and not a type-error.
More information about the Bug-openmcl
mailing list