freenode/#lisp - IRC Chatlog
Search
18:42:37
p_l
also, I think in ECLM/ELS in Amsterdam (2012) there was a presentation on using DSL and a compiler written in CL to generate much more efficient Cuda/OpenCL code
23:22:50
moon-child
how come (*) and (+) are usually well-defined (to multiplicative and additive identities), but (/) and (-) produce an error?
23:24:49
yottabyte
has anyone gotten drakma to work with windows 10 here? when I try e.g. (drakma:http-request "http://www.lisp.org/index.html") I get https://pastebin.com/MNLZeyS3
23:25:26
yottabyte
I tried to do some searching and it seems to be a CL+SSL error, but all I did was quickload drakma
23:26:15
aeth
moon-child: probably because / and - are actually two functions, depending on the lengths of the arguments provided, i.e. 1 argument vs. 2 or more arguments
23:27:21
moon-child
otoh, they still have well-defined identities, that are consistent for both forms
23:27:40
aeth
if they were defined like + and * then there would be no difference with (- and +) or (* and /) for 0 and 1 arg calls and there would need to be separate functions for negation and inverse
23:28:39
pjb
moon-child: the mathematical principle, is that (op) returns the neutral element for op. What is the neutral element of / or of - ?
23:29:21
aeth
(/ x) is (/ 1 x) instead of the "expected" x if it were just an extension of / for 2+ args and (- x) is (* -1 x) instead of the "expected" x if it were just an extension of - for 2+ args.
23:29:51
moon-child
pjb: ahh, I see. So it's not because there are separate forms, but because parameter order matters
23:30:22
pjb
moon-child: well, at least for neutral elements. an operation can be anti-commutative, but the neutral element should still commute.
23:30:29
aeth
or I suppose you could define (- x) as (- 0 x) instead so it parallels / more. That is, (- x) is (- (+) x) and (/ x) is (/ (*) x)
4:48:54
markasoftware
I want to pass the value of a variable as an argument to a function, if that variable is non-nil
4:49:07
markasoftware
otherwise i want to omit the argument so that the function can use its default value for it. (it is &optional).
4:49:51
markasoftware
Do I just make my own macro to handle this? Or is there some convenient way I am overlooking?
5:12:46
akoana
markasoftware: maybe use something like this: (defun f (&optional (p 'default supplied-p)) (if (and supplied-p (null p)) 'default p))
5:18:16
beach
I guess &aux is on my mind because I used it in my paper on representing method combinations.