Search
Tuesday, 5th of March 2019, 1:38:45 UTC
1:42:32
Josh_2
jasom: https://plaster.tymoon.eu/view/1233#1233 when I run (index-page) I only get <html></html>..
1:42:44
jasom
and for many (most?) real world examples I use &key rather than &optional because I have kwards
1:43:14
jasom
Josh_2: you aren't binding a special variable like I was
1:44:16
jasom
if you really want to build strings for each intermediate chunk you would want to do e.g. (str (header)) rather than just (header)
1:44:42
jasom
Josh_2: look at my example for uses of *html-outstream*
1:44:57
jasom
note that your paste has no such special variable
1:45:25
Josh_2
I want to make it a stream eventually
1:45:38
Josh_2
currently just using strings for convenience
1:45:55
Josh_2
while I mess around with cl-who, easy enough to change to a stream with replace-all
1:47:48
jasom
well all but the top-level ought not use string then
1:52:30
jasom
Josh_2: https://plaster.tymoon.eu/view/1234#1234
1:54:57
bitch
** NICK ||||||||||||||||
1:55:08
||||||||||||||||
** NICK |||||||||||||||\
1:55:12
|||||||||||||||\
** NICK \\\\\\\\\\\\\\\\
1:59:31
Josh_2
now I have to create a stream handling function for hunchentoot, so I can output that stream to my webpage
2:00:04
jasom
Josh_2: with-output-to-string?
2:03:44
Josh_2
First I gotta make a stream to write to
2:04:13
moldybits
is it possible to do something like this without defining a block first: (defun foo () (when bar (return)) ...)
2:04:18
jasom
which cl:with-output-to-string does for you, right?
2:05:16
jasom
moldybits: (when bar (return-from foo)) ...
2:05:39
jasom
moldybits: defun implicitly creates a named block
2:05:52
jasom
moldybits: http://clhs.lisp.se/Body/m_defun.htm
2:05:57
\\\\\\\\\\\\\\\\
** NICK bitch
2:08:53
moldybits
jasom: ah, it's named after the function. thank you!
2:09:27
Josh_2
jasom: I used (make-string-output-stream) and then (get-output-stream-string) and that worked
2:09:53
jasom
Josh_2: cl:with-output-to-string does that for you, FWIW
2:09:56
jasom
and also closes the stream
2:10:17
jasom
http://clhs.lisp.se/Body/m_w_out_.htm
2:10:49
Josh_2
I make the output stream then use with-output-to-stream?
2:11:44
jasom
I was suggesting with-output-to-string not with-output-to-stream
2:12:21
jasom
e.g. (with-output-to-string (*html-output*) (index-page))
2:12:42
jasom
that will return a string
2:16:29
jasom
or just (let ((*html-output*)) (send-headers) (index-page))
2:16:59
jasom
though IIRC that might be a binary stream, so you might have to make a bivalent stream on top of that
2:17:10
jasom
minor correction: (let ((*html-output* (send-headers))) (index-page))
2:17:31
jasom
(send-headers) on hunchentoot returns a binary stream that you can write the response to
2:21:02
Josh_2
Its a chunked io stream
2:22:59
Josh_2
huh, for some reason half my html is duplicating went sent to the stream
2:23:03
Josh_2
or in the stream I'm not sure
2:45:09
Josh_2
jasom: thanks for all the help :)
3:46:21
beach
Good morning everyone!
4:36:53
no-defun-allowed
abhixec: type `/quit` into your IRC client
8:37:42
no-defun-allowed
Morning splittist
8:49:35
varjag
long shot, but is there any cl implementation that supports arm neon intrinsics?
9:25:29
heisig
What does #lisp think about having an extensible defclass macro? Or is there already such a thing?
9:26:07
heisig
The idea would be that the metaclass can decide what clauses are allowed and how they are handled.
9:27:46
heisig
For example, one could define default methods for (:metaclass structure-class) that expand the entire thing into a defstruct definition.
9:51:06
shka_
heisig: does not sound like a good idea
9:51:56
shka_
heisig: defclass is supposed to be simple syntax sugar around setf find-class
10:02:58
heisig
shka_: I know. But how do I pass additional arguments to my custom metaclass? By not using defclass?
10:04:52
shka_
heisig: do you mean make-instance that creates your class?
10:05:19
heisig
Yes. With make-instance, I have full flexibility.
10:06:48
shka_
ok, so you want to pass extra options to make instance called on your metaclass, right?
10:07:17
shka_
do i understand correctly?
10:07:48
heisig
... and I'd like to be able to define additional toplevel forms, too :)
10:08:09
heisig
For handling options like (:predicate NAME).
10:09:19
heisig
But I am not sure whether that is a sane thing to do. The spec doesn't allow it, so I guess there must be a reason.
10:09:35
shka_
well, i think that passing additional options in usual place in defclass may be portable enough
10:10:02
shka_
you can't plug into shared-initialize with structs
10:10:17
shka_
ACTION scratches his head
10:11:52
shka_
shka_: i think that bridging structs and standard-classes can be non trivial
10:14:57
heisig
Yes, it is a nightmare. But I think it is doable with not too many caveats.
10:15:25
heisig
If it gets me rid of the syntax of defstruct, I'm willing to pay the price :)
10:15:41
shka_
heisig: i think i have an idea
10:16:07
shka_
since issue here is that you can't count on shared-initialize
10:16:43
shka_
maybe you can simply add your own initialize generic function and simply call it manually
10:17:03
shka_
with proper class, that is
10:19:44
heisig
shka_: I will think about it. Thank you for your input.
10:20:05
shka_
i am always happy to help
10:30:47
jackdaniel
heisig: do avoid controversy name it define-class
10:31:24
jackdaniel
(to have a common syntax for defclass and defstruct that is)
11:08:05
heisig
jackdaniel: Yes, shadowing CL symbols is not a wise move. I will either call it define-class or defclass*.
11:29:05
akater
Does SBCL do “translation to C” at any point to produce native code for ANSI CL? (I believe it's not but I'd like to make sure.)
12:25:28
Lord_of_Life_
** NICK Lord_of_Life
12:28:01
akater
TMA shka_: I'm aware of basics when it comes to SBCL and ECL, I just happened to encounter someone spreading claims that Lisp is hopelessly dependent on C.
12:28:06
akater
As far as I understand, once you have something like SB-SYS:*LINKAGE-INFO* and corresponding infrastructure, and have your system bootstrapped, there is no need to rely on C at all.
12:32:46
heisig
akater: The SICL project has also made a lot of progress towards bootstrapping Common Lisp from Common Lisp. It does not contain a single line of C code.
12:50:13
shka_
akater: this sounds like some C fanatic text
12:51:19
p_l
akater: where did you find such a person?
12:53:20
shka_
p_l: you need to believe in some virgins in heaven to write in C :P
13:32:19
varjag
lisp predates c so can't depend on it too much
Tuesday, 5th of March 2019, 13:38:45 UTC