freenode/lisp - IRC Chatlog
Search
9:44:38
phoe_
Well, it's true, but I read up on the logs and don't fully understand the context of mentioning me.
9:48:27
jackdaniel
stylewarning looks for a full-grown CL programmer who wouldn't require mentoring and will be able to solve some tasks with FOSS software (for money)
10:03:36
clintm
I probably shouldn't think about finding a cl job until I'm not asking about , vs. ,@ and ,@(x (( :P
10:05:01
clintm
I pasted a question earlier about writing a macro interface to something else. I think I closed the tab.
10:05:58
jackdaniel
I just gave you a context, beach suggested you are at least partially grown according to log
10:14:04
phoe_
geez, us at #lisp really have a habit of turning every discussion about foo into either a meta discussion about foo or a discussion about meta foo
10:17:40
phoe_
where you don't have explicit syntax, you have public AbstractLanguageSyntax<JavaSyntax> syntax = AbstractSyntaxBuilder.build(Syntax.JAVA, Syntax.EXPLICIT);
10:32:08
pjb
stylewarning: I'm available as a free-lance CL programmer. Contact me at pjb@informatimago.com for more info.
10:41:37
beach
phoe_: I am not doing the hiring for stylewarning, so I don't know the criteria. It just sounded to me that what he is faced with at the moment is to "grow" Common Lisp programmers from scratch. You are definitely more advanced that that.
10:41:39
beach
If you would be interested in something like that, if I were you, I would not hesitate applying. The company stylewarning works for would figure out whether you qualify. There is no shame in trying, as long as you are being honest about your qualifications.
10:43:28
beach
pjb: It might also be an investment. Ultimately, there would be more people available.
10:44:15
pjb
Depends on the company. If it's established and can make the investment, certainly. Startups have shorter-term concerns and often cannot.
10:44:55
beach
Right then, I was thinking more of the reason I often put in the time to help out newbies.
11:27:59
pjb
You need to find two lispers of different sexes first... Otherwise you only have 50% of chances of getting a new lisper :-)
12:18:22
phoe_
What is a way of destructively splitting a list into a list of elements that satisfy a predicate and a list of elements that don't?
12:26:12
lieven
(loop for x in '(0 1 2 3 4 5 6 7 8 9) if (oddp x) collect x into odds else collect x into evens finally (return (list odds evens)))
12:29:01
lieven
phoe_: seriously, if you need that kind of semantics, the data structure to use might be a vector
12:30:35
pjb
always: (sort list (lambda (a b) (and (funcall predicate a) (not (funcall predicate b)))))
12:31:12
pjb
(let ((predicate 'oddp)) (sort '(0 1 2 3 4 5 6 7 8 9) (lambda (a b) (and (funcall predicate a) (not (funcall predicate b)))))) #| --> (1 3 5 7 9 0 2 4 6 8) |#
12:33:22
pjb
(let ((list (list 1 2))) (let ((a list) (b (cdr list))) (setf (cdr a) nil) (values a b))) #| --> (1) ; (2) |#
12:34:33
pjb
Otherwise you can always use replace to make a non-destructive operation into a destructive one ;-)
12:35:26
pjb
cffi has a lot of problems. Of the biggests: It transforms structs in structs into pointers. It cannot deal with #pragma pack.
12:35:31
Shinmera
If you want it to not cons and can't afford a scratch space either just bubble sort I guess.
12:40:27
phoe_
pjb: Yes. LOOP is useless here since changing the list we iterate on is undefined behaviour.
13:06:24
phoe_
I'll need to make a Jesus symbol macro of sorts that is going to save me in such situations.
13:18:01
pjb
I've got a CoreMIDI/cffi layer that starts to work (I can send and receive MIDI events): https://framagit.org/patchwork/CoreMIDI (No docstring, cf. Apple's CoreMIDI doc). Have fun.
14:16:49
pjb
shka: So, not me, the musician is making it. I'm just porting the application to MacOSX.
14:20:52
oleo
you have to get the sequences right and then tune the effects and durations and whatnot.....
14:22:51
oleo
i'd prefer a realtime synth anyway..... other than for the inital feel of the music which you can compose via the tracker etc....
14:24:12
oleo
until you get used to all the stuff and find out some tricks etc....and know how to run stuff without the need for experimenting anymore....
14:32:09
pjb
http://overtone.github.io/ https://www.youtube.com/watch?v=xzTH_ZqaFKI https://www.youtube.com/watch?v=yY1FSsUV-8c
14:32:56
pjb
and also with visual effects: http://blog.josephwilk.net/art/live-coding-repl-electric.html
14:51:01
phoe_
I hate that idiom and always (defun cat (&rest strings) (apply #'concatenate 'string strings))
15:03:02
pjb
yes, but this cat is wrong. You need: (defun cat (&rest strings) (if (<= (length strings) (1- call-arguments-limit)) (apply #'concatenate 'string strings) (concatenate 'string (first string) (apply #'concatenate 'string (rest strings)))))
15:04:27
phoe_
pjb: no, why? I'm calling this function with one argument less than the maximum of (concatenate 'string ...)
15:05:52
pjb
Of course, with at least 50, we don't mind if we're limited to 49 instead, and with some implementations it's unlimited anyways, so it doesn't matter, but for exact correctness, here you have it.
15:07:15
pjb
concatenate can computer the total length and allocate a single block. with-output-to-string will have to provide only AMORTIZED O(n).
15:09:46
pjb
That makes me think about those ancient programmers who used an AM radio receiver near mainframes in the 60s to detect bugs in running programs…
15:12:39
p_l
pjb: by ear is still popular method of recognising buggy behaviour... and I'm not talking about code touching sound
15:13:02
Shinmera
pjb: There's papers published about intercepting keypresses on laptops using fluctuations in the wifi signals.
15:15:19
easye
pjb: I hadn't heard about AM radio debugging! Is there a source you can recommend to learn about that or is the story part of computer folk history?
15:20:39
pjb
Well, it could never be a systematic and definite debugging tool, but it certainly could be used by programmers and operators to detect unusual behavior. I can witness having seen (and heard) an AM radio on top of the IBM 3031 I programmed on back in 1982, and I've read about this several times elsewhere too.
15:21:44
pjb
Like, they had some kind of magnetic powder to debug magnetic tapes. With it you could easily see the blocks and even read the bytes on those half-inch tapes. (9 bit over half an inch are clearly readable).
15:23:11
dlowe
It may have been something only young people could do, but there was a very high pitched whine to it when the cpu would spin
15:26:47
easye
I guess the closest I ever got to that was figuring out that a Sun 3 was swapping due to the disk chatter. But that was obvious from how slow the system got anyways...
15:28:58
easye
With 4Mib of RAM, it wasn't hard to mess up the VM system with data reduction unless you were careful.
15:29:14
beach
I worked a summer job where they had implemented a program that played Bolero. The paper tape reader did the rhythm.
15:44:37
phoe_
stylewarning: I have some news from my side. I'm occupied with work and keeping my family stabilized financially.
15:44:41
phoe_
So it's impossible for me to take risks such as jumping off the corporate paycheck to something that might be rewarding me as a programmer but also risky or lower financially.
15:45:18
phoe_
So while I will want to hear more about your project because I'm quite interested in promoting Lisp, I doubt I'll be able to be a full-time supporter.
15:46:48
phoe_
stylewarning: you haven't, indeed, but since I showed you some interest, I think it's fair to also clarify if I'm able or unable to pick up the interesting stuff.
15:47:58
stylewarning
I think it's all interesting of course. Full-time work or some FOSS contract work.
16:11:50
slark
in english i would describe '(1 2 (3 4)) as a list of 3 element and the third elem is a a list of 2 element
17:29:02
oleo
so is it possible to turn off the garbage collector unconditionally or just for a while ?
17:40:30
ptdel
hello everybody ^_^ I was wondering if somebody more seasons in CL could tell me if I am goofing or not. I made a rolling-hmac function that I *think* is generating a valid hmac but I'm not sure if i'm making a mistep syntax-wise http://sprunge.us/CTdj
17:48:55
clintm`
First cup of coffee this am, but that should be easy enough to test, shouldn't it? If your hash matches a hash from a known good implementation, then you got it right. Erm, right?
17:51:20
clintm`
What if you fat-finger something in the python version? or is it as easy as loading a couple of libraries and calling one or more of the functions with a string?
18:23:38
shka_
how fast find on portable hashtable implementation can run when compared to sbcl implementation?
18:33:30
Bike
i don't think sbcl does anything especially tricky with hash tables, so it might be possible to be faster.
19:06:26
phoe_
I want to write a custom printing function that prints symbols as if with ~A but all other objects as with ~S. How should I approach this?
19:10:09
jackdaniel
(defun my-format (stream fmt-string args) (apply format string fmt-string (mapcar (lambda (o) (if (symbolp o) (format nil "~s" o) (format nil "~a" o)))))
19:13:58
phoe_
It's a bit more complicated. Basically, I will have data in form of lists that can contain numbers, symbols, strings, lists.
19:14:20
phoe_
I want to print symbols without any package information (so ~A) but strings readably (so ~S).
19:15:09
phoe_
I found a hack where I traverse the list and replace all symbols with equally-named gensyms and then bind *print-gensym* which gives me the result I want.
19:15:33
phoe_
shka_: I want to print stuff like (foo bar "baz" (quux 3)) to strings in a readable format in order to send it over the network.
19:19:18
phoe_
of course I can, but writing a traversal function is a bit further from "trivial" in my dictionary. :D
19:20:37
ptdel
back again if anybody can help ^_^ i got my hmac function working but am strugging to make another function to use it recursively http://sprunge.us/Aaig it seems any loop I tr gets me this type error :(
19:21:25
ptdel
i'll admit i'm not sure what the appropriate (loop mechanism would be, originall i tried (if (null lst) nil
19:22:09
Bike
i mean, how would you write this out in terms of hmac-sign for this particular argument? (hmac-sign 'this (hmac-sign 'key message))??
19:27:07
ptdel
yeah (hmac-sign ) just takes two arguments and makes an hmac of the first, updates it with the second, and then returns a digest
19:27:27
ptdel
and what i want to do is take that resulting digest, and put it through to make a new key, and update it with the second value in my list of values i pass
19:30:06
Bike
okay, so the easy way to do it is like death said: (reduce #'hmac-sign '("one" "two" "three") :from-end t)
19:30:42
Bike
recursively, it would be like (defun recursive-hmac (list) (if (= (length list) 2) (hmac-sign (first list) (second list)) (hmac-sign (first list) (recursive-hmac (rest list))))
19:31:44
ptdel
Bike _death you are awesome thank you so much for helping me understand this better. I'm still trying to get a hang of everything :-p
19:32:35
ptdel
_death i've been reading practical common lisp would they have some examples in there of a reduce function in cl?
19:36:21
_death
to make it simple, implement a function that takes a function, a list, and an initial value.. and calls the function in the appropriate way.. so (reduce #'* '(2 3 4) :initial-value 1) gives the same result as (* (* (* 1 2) 3) 4)
19:58:11
pjb
I should write a series of CL books. «Common Lisp nature», «Common Lisp assaisonné», «Common Lisp épicé». :-)
20:02:32
pjb
phoe_: (defun cl-user::as (stream arg colon at &rest parameters) (declare (ignore colon at parameters)) (format stream (if (symbolp arg) "~A" "~S") arg)) (format t "~{~/as/~^~}~%" '(foo :bar "baz"))
20:03:48
phoe_
I thought the same, but then I realized that it'd need to be quite recursive. Your solution does not work for (foo bar (((((baz "quux)))))) I think.
20:07:39
phoe_
Also, CL-PROTEST just got its first somewhat-serious usage. http://paste.lisp.org/display/351888
20:39:46
Grue`
ok there's definitely a regression in hunchentoot performance on windows between 2017-01-24 and the current quicklisp dist... now gotta use binary search to find where it broke
20:42:11
jsjolen
I think there's a library that helps you with parsing defun, defclass, etc. bodies (so you get the declarations, slots and so on for macro writing). Anyone remember if this is a thing or if I'm dreaming?
20:43:40
Grue`
the funnest part is that every time I change quicklisp dist version, it removes quicklisp-slime-helper so I have to reinstall it, and then reinstall everything else
20:44:57
Shinmera
jsjolen: There's multiple ones. For functions/lambdas/methods there's form-fiddle.
20:45:40
Grue`
XachX: well the comment here says it removes all packages so i thought it's to be expected http://blog.quicklisp.org/2011/08/going-back-in-dist-time.html
20:55:52
gendl
Hi, I have a piece of code which has a dispatch character #? which is not defined in some of the Lisps where I need to compile/load it -
20:58:27
gendl
So something like #+(and ccl windows-target) (#_SleepEx millis #$true) -- it chokes --
20:59:54
gendl
I tried that with (set-dispatch-macro-character #\# #\? #'(lambda(stream subchar arg) arg))
21:04:34
gendl
doing (set-dispatch-macro-character #\# #\I #'(lambda(stream subchar arg) arg)) doesn't fix it.
21:05:45
Shinmera
How about instead (set-dispatch-macro-character #\# #\$ (lambda (s c a) (read s t nil t))
21:13:12
MrSleepy
For the default install of quicklisp in clisp am I supposed to upgrade asdf after install? I get the following errors sometimes: https://pastebin.com/kbX4m087
21:14:15
MrSleepy
I tried upgrading asdf manually which seemed like it partially works but I am not sure if it's a bad idea to tinker around with something quicklisp relies on.
21:15:18
MrSleepy
not that I have any reason for it I started using it because it was basically the first one I saw in a book that was in the archlinux repo
21:15:19
Shinmera
Because there hasn't been a release in forever, it's not maintained much, lots of libraries do not cater to its oddities, it's slow, etc.
21:16:18
MrSleepy
Shinmera, I was gonna ask if you would recommend that one because I have it installed too haha
21:18:49
MrSleepy
That's kind of a bummer though with clisp, the cmd line intfc for it is nice out of the box for those of us who are fairly new to emacs. :[
21:20:44
MrSleepy
I just found that there is a readline wrapper for sbcl so that should probably settle most of my gripes actually
21:21:38
MrSleepy
_death, I still haven't learned the ins and outs of emacs because until I started fooling with lisp I used vim and command line for most stuff
21:23:39
_death
MrSleepy: ok.. I started learning CL and Emacs together.. it felt a bit overwhelmed at first but got it pretty quickly
21:24:56
MrSleepy
_death, I recently setup a small quickreference for emacs that should help give me some training wheels while I pick it up. :]