Search
Saturday, 22nd of September 2018, 8:21:39 UTC
9:17:08
|3b|
ah, most of the time seems to be quicklisp reading its list of systems to see if it knows about them :/
10:23:52
_death
beach: hey.. https://gist.github.com/death/c7f001b0ac900d66d0ddb989318d6d09
10:28:57
beach
In a few minutes I need to leave to go pick up drmeister and his family at the airport. I'll deal with it later. Thanks.
10:29:03
beach
You may have to remind me.
10:31:00
shka_
drmeister and his family?
10:32:28
shka_
i should check out status of clasp again
10:34:34
Shinmera
a lot has changed, but also not very much
10:34:57
Shinmera
tons of systems in ql don't run yet and installation is still a pain
10:35:42
shka_
well, clearly it is not mature
10:35:58
shka_
it would be fullish to expect that
10:37:05
shka_
ACTION crawls into the corner
10:37:09
jackdaniel
ACTION is a fool of expectations from clasp ;-)
10:37:56
shka_
well, constructing brand new implementation of common lisp is non trivial task
10:39:06
jackdaniel
brand new is exaggeration, sicl is brand new in a sense of being build from scratch
10:40:11
beach
And it is taking time too. :)
10:41:01
pjb
Branding is usually rather instantaneous. Building sicl, some parts get old before others are even designed :-)
11:17:54
paule32
i have following code, but there is a typo? i can't find the misstake:
11:17:54
paule32
http://dpaste.com/2B6XB0J
11:18:29
paule32
i use clisp, at the moment
11:19:20
makomo
you didn't quote your list
11:19:57
shka_
also, couple of other issues
11:19:57
paule32
(setq Bakterium '( ... ?
11:20:10
makomo
paule32: yes, otherwise it will try to evaluate that form
11:20:11
paule32
i know, the syntax/layout
11:20:25
makomo
since it's a list, it thinks it's an operator call
11:20:41
shka_
because at the end, there is a format call
11:21:01
makomo
shka_: it depends what he wants to do with that format
11:21:12
makomo
paule32: then just enter a string, don't use format
11:21:31
paule32
makomo: ~ for word wrap ok?
11:21:43
makomo
shka_: that's probably not his intention though, but i'm still leaving the possibility
11:21:51
makomo
paule32: oh, i didn't know that was a format directive
11:22:33
paule32
i saw in google, and somewhere ~ as wrap
11:22:56
makomo
http://www.lispworks.com/documentation/lw445/CLHS/Body/22_cec.htm
11:23:12
makomo
use the up arrow to find the whole list of format directives
11:23:49
makomo
hm, this is ~I, does just ~ even exist?
11:25:09
paule32
i would not ident the text, only wrap, around the screen at column 80
11:25:44
makomo
right, but ~ is definitely not the correct directive
11:25:57
makomo
directives are of the form "~<something>"
11:26:31
no-defun-allowed
~ by itself is a syntax error, ~~ writes a ~
11:26:47
makomo
paule32: take a look at all of the format directives and find what you need http://www.lispworks.com/documentation/lw445/CLHS/Body/22_c.htm
11:27:01
makomo
look under "printing", "pretty-printing", "layout control"
11:46:13
pjb
makomo: ~ alone doesn't exist as format specifier. But #\~ #\newline do!
11:46:45
pjb
makomo: (format nil "~") #| ERROR: Premature end of control string "~" |#
11:47:42
pjb
makomo: you can also use the : and @ flags with #\~ #\newline.
11:47:49
makomo
here it is http://www.lispworks.com/documentation/lw445/CLHS/Body/22_cic.htm
11:52:50
paule32
i have terrible internet connection
11:53:11
paule32
was something up, at last minutes?
11:58:15
phoe
Is there any cross-implementation means of defining GC hooks?
11:58:35
phoe
trivial-garbage doesn't seem to have them.
11:59:50
phoe
I want to run some code after each time the GC is triggered.
12:00:17
shka_
eh, i don't think that there is anything for that
12:02:00
Bike
not all gcs are even the same. you might have an incremental or generational gc
12:03:33
no-defun-allowed
You could hypothetically have no gc, the standard says nothing about requiring one.
12:03:40
no-defun-allowed
Implementors aren't stupid though.
12:12:35
pjb
no-defun-allowed: Movitz doesn't have a GC (on purpose, since it's a kernel implementation implementation).
12:15:07
no-defun-allowed
I thought it had a stop-copy gc.
12:18:48
pjb
Well Mezzano superseded it somehow…
12:19:56
no-defun-allowed
Mezzano has a generational gc.
12:20:06
no-defun-allowed
Movitz will still have a very odd place in my heart though.
12:21:07
pjb
no-defun-allowed: If only we could make a few clones of ourselves, to take Movitz and fly with it!
12:22:36
no-defun-allowed
(dotimes (foo 20) (make-instance 'pjb))
12:31:26
phoe
(dotimes (foo 20) (copy-lisper pjb))
12:31:58
phoe
since structs have a copy facility
12:33:22
phoe
...damn, I just realized that I'm facing a problem that could easily be solved using continuations - if I only could save the stack somewhere and somehow
12:36:03
no-defun-allowed
Load cffi and use setjmp.
12:41:32
flip214
phoe: https://www.cliki.net/CPS, http://quickdocs.org/cl-cont/
12:42:03
flip214
or, if you don't want that library, just pass lambdas around... ;)
12:44:22
phoe
flip214: yes, I'm thinking of it right now
13:13:25
shka_
phoe: what are you trying to do?
13:23:56
phoe
shka_: implement a reader for a Lisp-like protocol, except the reader may be interrupted at any point (for example, by NIL returned from READ-CHAR-NO-HANG) and it should be possible for it to remember what it read so far and restart reading when input is available again
13:29:05
shka_
phoe: and protocol is in the form of...?
13:29:13
phoe
S-expressions, more or less
13:29:25
phoe
parens, symbols, strings, numbers
13:30:57
phoe
in the worst case, I'll just remember the part of the string that was read so far, save it somewhere, and then start reading again from a concatenated stream
13:31:53
phoe
if we read "(1 2" then we save that string somewhere, so later we may read "3 4 5)" which will give us the resulting (1 23 4 5)
13:32:42
shka_
and what if 3 4 5 will be read multiple times?
13:32:57
phoe
multiple times? what do you mean?
13:33:22
phoe
let's assume that we're reading from a network socket - when a character is read from that socket's stream, it won't be read again from it
13:36:27
pjb
You could invent a reader macro to read parts several times.
13:36:59
pjb
eg. (1 2 #3[ 4 5 6 ]) reads as (1 2 4 5 6 4 5 6 4 5 6).
13:38:05
pjb
But for a character by character repeatition, it'd be harder, because in your example, the prefix would already be parsed…
13:39:13
phoe
Yep, my issue is that I need to be able to return control any time READ-CHAR-NO-HANG returns NIL, meaning, there's no character available for reading.
13:39:33
phoe
And then I need to be able to rewind the stack and continue reading from the exact same position and state.
13:40:36
phoe
No - once there is some input on the character stream again.
13:40:48
shka_
ah, you don't want to block?
13:40:51
phoe
Once READ-CHAR-NO-HANG is able to return non-NIL.
13:40:54
phoe
Yes - I don't want to block.
13:41:11
phoe
If I could just call a blocking READ or anything similar, that wouldn't be an issue.
13:45:38
phoe
I don't want to create hundreds+ of threads just to make sure my connectivity works
13:45:44
shrdlu68
shka_: I tried a tree thing: https://gist.github.com/shrdlu68/117d02da6390d9ff8d45dd719412f17e
13:45:57
phoe
Since it's possible that I will have hundreds+ of simultaneous connections
13:59:45
phoe
Error: The variable X is unbound. [Condition of type UNBOUND-VARIABLE]
14:14:05
shka_
so it should not by any better
14:14:05
asarch
An off-topic question: what is comment in CSS?
14:15:28
asarch
Any good IRC client written in Common Lisp?
14:15:35
shrdlu68
shka_: It's better, memory-wise. But performance is horrible.
14:15:47
phoe
asarch: a user-facing client? I don't know, might be none
14:15:48
oni-on-ion
css: Found premature EOF or No input files
14:15:55
phoe
but there's plenty of libraries
14:16:17
shka_
shrdlu68: worse then my version?
14:16:33
asarch
There is a small one called ii
14:17:22
asarch
I'm planning to write a web interface for an IRC client written in Common Lisp so I could check all the messages from any PC connected in the LAN
14:17:55
shrdlu68
shka_: Lemme compare them.
14:18:24
oni-on-ion
asarch: sounds cool. i had a very pleasant time setting up cl-irc for a similar purpose the other day.
14:26:34
phoe
How can I create an output stream that forever blocks? I need it for testing purposes.
14:27:09
phoe
In other words, I want to create a modified string output stream that, for example, outputs "a b" and then hangs indefinitely (READ-CHAR-NO-HANG returns NIL on it).
14:28:09
phoe
shka_: what exactly about flexistreams?
14:28:46
shka_
phoe: in-memory flexistream
14:29:18
phoe
sure, but the in-memory flexistream will AFAIK behave the same way a string output stream behaves
14:29:26
phoe
which is to output everything, and then return EOF
14:29:35
phoe
I want it NOT to return an EOF and instead hang
14:29:41
phoe
More or less like a network socket stream
14:29:52
phoe
Except I don't want to create network sockets for that, since that would be a hack
14:30:10
shrdlu68
shka_: Interestingly, converting to a vector instead of a class improves performance 2x.
14:30:47
shka_
shrdlu68: struct should be equally good
14:30:49
shrdlu68
Actually that might have to do with the fact that each child node is only created when needed.
14:31:52
shka_
but there is more going on here
14:32:21
shka_
if i was you, i would try to introduce bitmask into my tree node and use this to compress vector
14:32:25
phoe
wait, not an output stream - an input stream
14:32:28
phoe
agh! I always confuse these two
14:44:14
Posterdati
please help, how can I handle :ENOTCONN error during a socket connection?
14:46:11
dlowe
I'm pretty sure that means you've set the socket to non-blocking mode before connecting
14:47:20
dlowe
you're getting ENOTCONN from connect()?
14:49:02
Posterdati
yes, but cannot intercept it in the client thread with handler-case
14:49:44
Posterdati
I placed in the handler-case (iolib/sockets:socket-not-connected-error () ... )
14:50:14
Posterdati
it didn't work when connection was established and server went away
14:50:44
ggole
IIRC connect(2) doesn't generate ENOTCONN, read(2) does
14:50:57
dlowe
try handling iolib:socket-error and iolib:hangup
14:51:17
ggole
(and similar calls like recv, I guess)
14:51:34
dlowe
https://github.com/dlowe-net/orcabot/blob/master/src/main.lisp#L115
14:51:34
Posterdati
but why :ENOTCONN error then?
14:51:45
dlowe
I handle a lot of different potential network errors
14:52:01
dlowe
ENOTCONN is when you try to use a socket and it's not connected
14:52:19
dlowe
you don't want a socket to be connected if you're using it for connecting
14:52:23
Posterdati
and it is correct, I had this error because the server went away
14:54:44
flip214
phoe: you can use a CONCATENATED-STREAM and have first a STRING-OUTPUT-STREAM and then some pipe or socket
14:54:54
Posterdati
mmmh I placed iolib/sockets:socket-error in the thread, but fallen in to the debugger...
14:56:29
phoe
flip214: yes, but employing sockets for that looks pretty un-clean to me
15:02:36
flip214
phoe: well, how about your own stream class that just never returns data?
15:02:49
phoe
flip214: I'm thinking of that
15:02:57
phoe
writing a trivial Gray stream class and methods on it
15:03:00
_death
it's unlikely that you actually want something that "hangs indefinitely".. you can use gray streams to define a stream that makes sense
15:04:48
Posterdati
people! I founf the problem, I used remote-host and remote-port on the error handler-case on the dead socket :), now I removed them and it worked!
15:04:54
flip214
phoe: if you would be so kind as to create a github project with a stream that outputs _only_ what gets written to it? a "pipe stream"?
15:06:00
phoe
flip214: I'll think of it, sure
15:18:45
shrdlu68
flip214: Isn't this the natural function of streams?
15:32:50
phoe
flip214: https://github.com/smithzvk/cl-plumbing
15:36:09
phoe
and https://github.com/phoe/everblocking-stream
15:36:16
pjb
Posterdati: you may want to save the remote-host and remote-port before it closes!
17:48:31
phoe
this cl-plumbing thing actually creates a Unix pipe
17:48:36
phoe
that's not a OS-portable solution
17:49:28
phoe
...or rather, wait, it does have two versions - a gray streams one and a non-gray-streams one
18:03:11
phoe
...with the Gray streams one being bugged
19:09:13
pjb
phoe: if you want a pure gray stream pipe, have a loot at com.informatimago.clext.pipe
19:13:31
phoe
flip214: I actually made a PR there that fixes some gray-streams stuff
19:20:45
flip214
phoe: awww, that uses polling.... well, for testing it won't matter
19:36:23
phoe
flip214: yep, it could use condition variables
19:40:39
paule32
http://dpaste.com/0ZEF17T
19:40:40
paule32
in the code, there is somewhere a colon error (clisp)
19:40:45
paule32
excepeted the unbound variables
19:40:53
paule32
can you help me please?
19:43:24
phoe
flip214: https://github.com/smithzvk/cl-plumbing/issues/3
19:52:37
pjb
on the other hand, you have a parenthesis error.
19:54:20
paule32
illegal terminating character after a colon: #\; Line: 514, Column: 1, File-Position: 21863
19:54:38
pjb
paule32: also, you're confusing program and data.
19:56:25
pjb
paule32: nope. [1]> (load "/tmp/a.lisp") ;; Loading file /tmp/a.lisp ... *** - READ: input stream #<INPUT BUFFERED FILE-STREAM CHARACTER #P"/tmp/a.lisp" @516> ends within an object. Last opening parenthesis probably in line 413.
20:00:55
pjb
paule32: that's because you're not using emacs.
20:01:07
phoe
or any other editor that counts parentheses for you
20:01:46
pjb
paule32: but you can be smart: (with-open-file (source #P"/tmp/a.lisp") (loop for sexp := (read source nil source) :until (eq sexp source) :do (print sexp)))
20:05:26
pjb
to read the tutorial (1/2 hour).
20:05:38
pjb
C-h t = type control-h and then t
Saturday, 22nd of September 2018, 20:21:39 UTC