freenode/lisp - IRC Chatlog
Search
11:27:25
MichaelRaskin
|3b|: I don't think so; cl:loop must have an expansion. but nobody prohibits this expansion being ext:loop-impl (special form)
11:30:31
|3b|
"An implementation is free to implement any macro operator as a special operator, but only if an equivalent definition of the macro is also provided. ", so that would be stretching things a bit
11:36:12
MichaelRaskin
The standard macros should have expansions, but nobody says they should be standard
11:36:57
MichaelRaskin
… and defun has a high chance to be indeed expanded to something interesting.
11:37:40
|3b|
i'd argue that "expands to a special form" should be included in "implement .. as a special operator", but it is poorly phrased there
11:39:04
MichaelRaskin
|3b|: I agree that it would be better if it was explicitly specified that all standard-defined macros used in portable code should expand into portable code
12:06:38
phoe
I love that thing when I need to operate on some body of code, like, wrap every element of that code with a list
12:06:54
phoe
And I just copy it, jump to the REPL, do a quick MAPCAR, copy the result, paste it back into the code.
12:19:03
|3b|
similarly C-- C-x C-e evals last expression and saves result to kill ring so you can paste it elsewhere
12:57:49
pjb
phoe: I don't even go to the REPL, I do that in the lisp buffer in emacs, wrap a pprint around it, and type C-u C-x C-e
14:13:36
jackdaniel
afaik he is now busy with his game, you may track its development progress here: http://techsnuffle.com/
14:41:06
devon
Optima, Trivia and other pattern matching libraries have does-this-node-match-this-pattern but seem to lack find-a-match-at-or-below-this-node, am I missing some wild-inferiors or similar feature?
16:14:00
pjb
(destructuring-bind (car . cdr) '(a b (c . d) e f) (list :car car :cdr cdr)) #| --> (:car a :cdr (b (c . d) e f)) |# yep, it matches.
17:49:56
Josh_2
can someone tell me if there is a better way to do what I'm doing here. https://plaster.tymoon.eu/view/1100#1100 ?
18:07:19
Josh_2
_death: well it wasn't originally, it was always 4 but then I ran into issues where just bit shifting and logioring the values would work, until there were trailing 0's
18:07:51
Josh_2
if there were trailing 0's I'd get outputs I don't want as the bytes are being sent from a Java client
18:14:37
_death
from the transcript at the bottom I am guessing the issue is little endian vs. big endian
18:22:36
Josh_2
I saw this https://stackoverflow.com/questions/21973387/casting-8-bit-int-to-32-bit obviously C but still
18:24:25
Josh_2
Well it showed me the issue, because I do have to flip the order on 4 byte sequences like #(1 0 0 0) or I end up with huge numbers instead of just 1
18:25:34
Josh_2
or reverse it. And then when I get an input like #(0 0 34 45) it has to be #(34 45 0 0) not #(45 34 0 0)
18:32:45
Josh_2
then if I bytes-to-int it without stripping the trailing 0's I get 70778880 (27 bits, #x4380000)
18:33:54
_death
forget bytes-to-int.. first verify in the Java program that the array you get is #(56 4 ...)
18:39:04
phoe
in order to verify it, don't send it over the network, print it to console from the Java side
18:40:09
_death
Josh_2: are you saying that you printed the array in the Java program and it showed 4 as the first byte?
18:41:11
phoe
_death: I guess so. big-endian is the "natural" order of writing digits where little-endian is the inverse
18:41:27
phoe
so the number 123456 in big endian would be 123456 and in little endian would be 654321
18:42:35
Josh_2
usocket:socket-recieve requires that you either give it a buffer or a length of a buffer it will create
18:46:33
Josh_2
and the buffer you give it has to be a specific size already, you can't make it extendable so it'll fit just right
18:48:41
phoe
yes, bigintegers can be arbitrarily large so Java can send you something that is 9001 bytes long
18:50:10
phoe
if you want to go this way, then you'll likely never get a screen that's larger than 65535x65535
20:58:07
pjb
puchacz: you can put reader macros on [-+0-9] so that you can read 1_000_000 ; also on _, because I would admit _123_456.
21:25:15
no-defun-allowed
are there any fancy (human) language parsers like prolog-talk in quicklisp?
21:48:15
no-defun-allowed
i'd like to take some english text, make it into a parse tree, and possibly turn it back later
21:54:38
no-defun-allowed
is there anything on using cl-nlp? i found tokenizing but just doing apropos on variable names doesn't seem too efficient
21:59:35
fiddlerwoaroof
margaritamike: using lquery, it would be something like this: (lquery:$ (initialize "<html><!--foo--></html>") (children) (contents) (filter #'plump:comment-p))
22:00:17
fiddlerwoaroof
lquery is a little dsl wrapper around plump that makes traversing xml a lot nicer