freenode/#sbcl - IRC Chatlog
Search
17:30:45
stassats
hmm, reinitialize-instance on classes doesn't call reinitialize-instance on subclasses, and my update-dependent isn't invoked
18:53:52
sjl_
(with-open-file (f "foo" :element-type 'base-char) (read-line f)) currently returns a simple-string. Is there any way to get it to return simple-base-string's instead?
18:54:43
sjl_
my use case is reading data from large (10-100gb) FASTQ files (data from DNA sequencers)
18:54:59
sjl_
[ClozureCL] COMMON-LISP-USER> (type-of (with-open-file (f "~/.stumpwmrc" :element-type 'base-char) (read-line f)))
18:57:13
stassats
if you're relying on character streams to read 100gb fast, you're already losing, and then adding read-line
18:58:33
stassats
you're not going to just leave the data as lines? so anything read with read-line will be garbage
19:00:47
sjl_
Like, from the perspective of writing a library to handle FASTQs, I'd hope to provide something like (do-fastq (label sequence scores) stream ...)
19:01:31
sjl_
No, FASTQ files can be used for DNA (ATGC), RNA (AUGC), or protein (20 different letters)
19:03:24
sjl_
I still need to read it in. I was hoping that I could get away with something nicer than reading into an octet buffer and parsing it myself. But maybe that's just the best solution.
19:04:21
sjl_
(I already wrote the octet-buffer solution, and it got much messier than the read-line solution)
19:10:48
stassats
i suppose read-line could return a simple-base-string, but that might break some code
19:12:44
sjl_
The standard does seem to allow it. But yeah, currently (stream-element-type (open "~/.stumpwmrc" :element-type 'base-char)) ; => CHARACTER
19:14:21
sjl_
It could break code that read-line's a stream opened with :element-type 'base-char but then tries to store a (and character (not base-char)) into the resulting string later.
19:15:21
stassats
you'll have to have (declare (#+sbcl one-thing #+old-sbcl another-thing #-sbcl something-else)
19:18:04
sjl_
It seems odd to request a stream of element-type base-char and then declare the contents of the stuff you get from it to be character
19:20:47
sjl_
So people writing (declare (type (simple-array character (*)) foo) aren't basing that on the standard, but rather just what SBCL has historically done