libera/#lisp - IRC Chatlog
Search
16:17:09
q3cpma
Hello, anyone knows if the ECL compiler is supposed to work with files calling load directly? Here, it doesn't find the package defined in said loaded file.
16:20:33
q3cpma
Huh, added an eval-when and it worked. Aren't top-level statements executed during compilation?
16:24:32
pjb
q3cpma: no, toplevel expressions are only evaluated when loading the source or the compiled file.
16:24:58
pjb
q3cpma: that said, some toplevel expressions are macros that expand to eval-when :compile-toplevel … so they also have compilation-time effects.
16:25:19
pjb
q3cpma: eg. in-package (macroexpand-1 '(in-package :foo)) #| --> (eval-when (:execute :load-toplevel :compile-toplevel) (ccl::set-package "FOO")) ; t |#
1:30:09
Ox151
hello, i am experimenting with streams. would anyone know why this gets into an infinate loop? https://paste.debian.net/1254997/
1:30:54
Ox151
I am using caveman2 framework and trying to read a multipart/form file upload. i can recongize it as a stream, read bytes from it, but it never stops and I am wondering why it doesn't get to :eof
3:10:36
aeth
Ox151: If it's a network thing, perhaps try checking with LISTEN first? http://www.lispworks.com/documentation/HyperSpec/Body/f_listen.htm
3:12:10
aeth
If LISTEN is NIL then you can (sleep 0.1f0) or something. And timeout if it never finishes.
3:14:00
aeth
This should be an edge case, though, not something that shows up first, unless it's interactive like, say, an IRC client.
3:16:39
Ox151
aeth: i think i am just a little slow.... so I was printing out each byte and it takes like 3 min to completelty print out all the bytes. but if I dont print anything it writes and finishes almost immediently
3:19:33
Ox151
given a stream is there any stat commands to get size of bytes or any type of information?
3:20:29
aeth
might be FILE-LENGTH http://www.lispworks.com/documentation/HyperSpec/Body/f_file_l.htm
3:21:47
aeth
if it's a custom stream it's probably using this API though. http://www.nhplace.com/kent/CL/Issues/stream-definition-by-user.html
3:22:09
aeth
(it failed to get into the standard, but implementations have it anyway, as trivial-gray-streams)
3:24:48
aeth
if you can get the length somehow through some API then you can use read-sequence. http://www.lispworks.com/documentation/HyperSpec/Body/f_rd_seq.htm
3:26:24
Ox151
i am using read-sequence right now with a const buffer size. thanks for the information, ill keep digging.