freenode/#lisp - IRC Chatlog
Search
11:02:33
Josh_2
Well I want to make some software that lets me share my mouse/keyboard across my Gentoo install and Windoge
11:30:30
JuanDaugherty
well i essentially have tnat now. looking at a 36 desktop fvwm pager, don't have a dos vnc session right now
11:31:40
JuanDaugherty
so if i used guacamole or any of a plethora of other things could share it with others in a browser
11:34:35
JuanDaugherty
as to whether there's a cl binding to whatever currently replaces win32, i would guess not but not with confidence
11:37:37
JuanDaugherty
it used to be win32 and wouldn be surprised if it was win64 now but doubt that, again with little confidence
11:42:01
JuanDaugherty
doesn't slime show up on the main menu bar anymore? it executes fine but there's no slime menu when I have a lisp file open
17:37:57
mfiano
drmeister: It depends, really. Do you mean combinations or permutations? Are repetitions allowed? Are the inputs always guaranteed to be "sets"? etc
17:41:51
mfiano
drmeister: Depending on your answers, it can be a Cartesian product, combination, permutation, permutation with repetitions (different), the "Power set", etc
20:15:39
drmeister
Hi mfiano - thank you - it was the cartesian product that I was looking for. This function does the job nicely.
20:57:04
sjl
but it always confuses me that some of the map-* ones collect the results of the function you pass and others dont
20:58:00
sjl
well, map-permutations returns nil, map-combinations returns the sequence you pass it, and map-product returns a list of the results
21:03:57
sjl
oh fun, map-permutations sometimes returns nil only if you permute the entire sequence, but returns the original sequence if you permute a subsequence of it
21:05:49
sjl
hah, if you pass it a one-element sequence though, it returns the result of your function :)
21:30:42
stacksmith
Could someone clarify CLHS eval description "The evaluator expands macro calls as if through the use of macroexpand-1"... Why is it limited to 1 level of expansion?
21:32:16
Bike
because the algorithm is more complicated. for example, it can do compiler macroexpansion too
21:35:32
stacksmith
However, if eval is limited to 1 level of macroexpansion, would it not behave differently from compiling identical code?
21:36:06
Bike
it says it works like macroexpand-1 does, but it doesn't say it can't do that more than once
21:36:28
phoe
if you have (+ (foo) (bar)) then eval first starts evaluating the whole call, but then since it's a function call, it must evaluate its arguments
21:39:12
stacksmith
phoe: CLHS 3.1.2.1.3 A form that is neither a symbol nor a cons is defined to be a self-evaluating object.
21:40:23
stacksmith
Bike: why is it relevant to mention that eval acts as if it does a macroexpand-1?
21:42:19
stacksmith
Sometimes not understanding seemingly trivial things leads to terrible problems in the 'internal model' of how things work.
21:42:46
Bike
well, as concerns your comment about compile/eval divergences, those are pretty strictly laid out
21:43:09
phoe
You can't define any macros on self-evaluating objects, hence evaluating them can have no side effects.
21:43:38
phoe
So theoretically an implementation would be allowed to optimize away such calls when it notices that it would have no effect anyway.
21:43:53
phoe
Or, for simplicity, it could call eval on them anyway just to have it immediately return.
22:01:07
phoe
every time you evaluate the number 42, a random file is deleted on your computer as a side effect
22:09:58
stacksmith
Here is another one: CLHS 3.4.4.1 Destructuring lambda-lists starts with "Anywhere in a macro lambda list where a parameter name can appear, and where ordinary lambda list syntax (as described in Section 3.4.1 (Ordinary Lambda Lists)) does not otherwise allow a list, a destructuring lambda list can appear in place of the parameter name"... Does this imply that &rest parameter may be a destructuring lambda-list?
22:12:07
stacksmith
I don't think I've ever encountered it... Is it any different from using &whole and destructuring in required parameters?
22:15:53
stacksmith
Bike: example: (defmacro foo (a &rest (b c))) as opposed to (defmacro bar (a (b c)))? Is there any difference?
22:16:27
Bike
(foo 1 2 3) is valid for the first but not the second, (foo 1 (2 3)) is valid for the second but not the first
22:17:33
stacksmith
(defmacro foo (a &rest ((b c)))) as opposed to (defmacro bar (a (b c))) then. I think I see.
22:17:54
Bike
you could understand them as (defmacro foo (a &rest s) (destructuring-bind (b c) s ...)) and (defmacro foo (a s) (destructuring-bind (b c) s ...))
22:19:26
specbot
Lambda-list-directed Destructuring by Lambda Lists: http://www.lispworks.com/reference/HyperSpec/Body/03_ddab.htm
22:23:37
Bike
what the environment object is is a mystery, so it couldn't reasonably be destructured.
22:23:47
stacksmith
"&environment is followed by a single variable..." Forgive my ignorance, but what does the environment look like? Is it a list?
22:24:31
Bike
the only thing programmers can do with them is pass them to functions (e.g. macroexpand-1)
22:25:11
Bike
as examples, on sbcl it's a structure object (so it couldn't be destructured), while on ecl last i checked it's an alist.
22:25:34
Bike
in fact, the standard goes so far as to give them dynamic extent, meaning that it's not allowed to keep them after the macro is done expanding.
22:26:32
stacksmith
Interesting. I think that covers all lambda-list-keywords that have no init-forms...
22:35:59
stacksmith
Bike: last question on the topic... Is (lambda foo (&rest rest &key a b c)) identical to (lambda (bar &rest (&key a b c))?
22:37:24
stacksmith
I mean in a macro. Let me try again (defmacro foo (&rest rest &key a b c)) vs (defmacro bar (&rest (&key a b c)))
22:37:43
Bike
well, the former binds a variable called 'rest', but otherwise i think they'd be the same.
22:45:52
stacksmith
Bah, apparently I am not done here... CHLS 3.4.4.1.2 : each element of &key may be a ."..or a list of a list of a keyword and a destructuring pattern, an optional initialization form, and an optional supplied-p variable.". In this context, what can a destructuring pattern be?
22:46:16
specbot
Lambda-list-directed Destructuring by Lambda Lists: http://www.lispworks.com/reference/HyperSpec/Body/03_ddab.htm
22:48:21
stacksmith
I am having trouble envisioning it... I've seen single symbols and assumed it was just a way to change the name of the binding inside...
22:48:48
Bike
well, like in the lambda list (a (&key x) &rest r) the (&key x) is a destructuring pattern.
22:50:27
Josh_2
I'm trying to read from /dev/mouse1 which is a 32bit integer (I believe) using read-line/read-byte doesn't work and I'm not sure how to specify 32 bit unsigned int as the type spec to (with-open-file ..
22:50:30
stacksmith
Could you give me an example of something more complicated than ..&key ((:x localx))
22:51:42
Bike
by the way, if it's not clear, i've never seen any of this stuff you're asking about in real code
22:53:14
Josh_2
" #<SB-SYS:FD-STREAM for "file /dev/mouse1" {100416FCE3}> is not a character input stream."
22:54:43
stacksmith
Bike: in your example, what does that mean? Does it mean that :x (1 2) is a valid argument that will bind z=1 and w=2?
22:56:22
stacksmith
Bike: that is incredible...I never thought of it. I am so happy I asked! Bike: I truly appreciate you putting up with my nonsense.
22:58:41
Bike
well, i don't know how /dev/mouse1 works, but it might not be an infinitely long file.
22:59:03
Josh_2
Well as you scroll it prints new, so when I cat /dev/mouse1 it appears to be infinite