2015-12-30T00:00:12Z White_Flame: I don't have the source in front of me 2015-12-30T00:00:36Z jasom: White_Flame: http://letoverlambda.com/index.cl/guest/chap4.html C-f dangerous-use-of-bq 2015-12-30T00:00:41Z White_Flame: but if there's a list literal in the source code inside a function body, it does not create a new object on each function call 2015-12-30T00:00:42Z arademaker: (defun dangerous-use-of-bq () 2015-12-30T00:00:43Z arademaker: `(a ,. '(b c d) e)) 2015-12-30T00:01:14Z rpg: jasom: It occurs to me I don't know: is that behavior *guaranteed* by the spec, or just *permitted* by the spec (i.e., could two quoted lists be actually the same memory if the implementation wanted to do something funky)? 2015-12-30T00:01:22Z White_Flame: yep, that sets the cdr of the last cell of (b c d) to connect to ....e) 2015-12-30T00:01:40Z White_Flame: meaning that literal list now looks like (b c d e) 2015-12-30T00:01:48Z arademaker: in the read time, right? 2015-12-30T00:01:56Z White_Flame: no, the modifiction happens at function call tiem 2015-12-30T00:01:58Z Bicyclidine: rpg: they can, it's called "coalescing" in the compiler semantics somewhere 2015-12-30T00:02:00Z jasom: rpg: I'm searching for that now; most recent thing I found here was X3J13 voted in March 1989 (QUOTE-SEMANTICS) to clarify that eval and compile are not permitted either to copy or to coalesce (``collapse'') constants (see eq) appearing in the code they process; the resulting program behavior must refer to objects that are eql to the corresponding objects in the source code. Only the compile-file/load process 2015-12-30T00:02:02Z jasom: is permitted to copy or coalesce constants (see section 25.1) 2015-12-30T00:02:19Z jasom: rpg: which would mean if that form appeared in a file, then they could be coalesced 2015-12-30T00:02:20Z White_Flame: though it's allowed to happen at compile-time 2015-12-30T00:02:24Z Bicyclidine: there's a bunch of complicated rules for what can coalesce 2015-12-30T00:02:29Z White_Flame: (I think ... :-P) 2015-12-30T00:02:40Z Bicyclidine: clhs 3.2.4 2015-12-30T00:02:40Z specbot: Literal Objects in Compiled Files: http://www.lispworks.com/reference/HyperSpec/Body/03_bd.htm 2015-12-30T00:02:41Z jasom: but that's from CLtL2, not the hyperspec 2015-12-30T00:04:08Z pjb: White_Flame: in LISP 1.5, 0 = NIL = (). 2015-12-30T00:04:13Z pjb: = false. 2015-12-30T00:04:16Z jasom: Bicyclidine: that says they must be similar, but not if they are allowed to be the same under eq 2015-12-30T00:04:27Z Bicyclidine: yeah, i'm lookin' 2015-12-30T00:04:43Z Bicyclidine: "The term coalesce is defined as follows. Suppose A and B are two literal constants in the source code, and that A' and B' are the corresponding objects in the compiled code. If A' and B' are eql but A and B are not eql, then it is said that A and B have been coalesced by the compiler. " 2015-12-30T00:04:49Z Bicyclidine: well that's not terribly helpful 2015-12-30T00:05:09Z Bicyclidine: well, i suppose you can infer that the compiler can coalesce from the definition of similarity allowing it 2015-12-30T00:05:16Z oleo_: lol 2015-12-30T00:05:32Z Bicyclidine: oh, wait, it's in 3.2.4.4 2015-12-30T00:05:33Z oleo_: are we over the confusion yet or still in it ? 2015-12-30T00:05:37Z oleo_: hahahaha 2015-12-30T00:05:42Z Bicyclidine: "If two literal objects appearing in the source code for a single file processed with the file compiler are the identical, the corresponding objects in the compiled code must also be the identical. With the exception of symbols and packages, any two literal objects in code being processed by the file compiler may be coalesced if and only if they are similar; if they are either both symbols or both packages, they may only be coalesced if and 2015-12-30T00:06:00Z Bicyclidine: and hey! a typo! 2015-12-30T00:06:12Z arademaker: White_Flame: in the function call time the modification is made. but in the reading time of the function def the literal is created in a given memory location. further calls to the function modify the same instance. 2015-12-30T00:06:31Z White_Flame: correct 2015-12-30T00:06:42Z White_Flame: so if it's called twice, the return value from the first one is also modified 2015-12-30T00:07:02Z White_Flame: in this particular case, it'll still look like (b c d e), but the 'e' will be in a different cons cell than originally 2015-12-30T00:07:02Z oleo_: ok 2015-12-30T00:07:24Z arademaker: yes, I got it. Thanks. 2015-12-30T00:09:25Z gabriel-artigue is now known as gmislata 2015-12-30T00:12:45Z pbgc quit (Quit: Textual IRC Client: http://www.textualapp.com/) 2015-12-30T00:13:39Z varjagg quit (Ping timeout: 255 seconds) 2015-12-30T00:17:46Z Einwq quit (Quit: Leaving) 2015-12-30T00:18:04Z arademaker: slime don't like the read macros from cap.4 of lol = let over lambda! 2015-12-30T00:18:32Z arademaker: wow, paredit-mode doesn't like it too. 2015-12-30T00:18:56Z jasom: slime recently got a lot worse with read-macros for me 2015-12-30T00:19:16Z jasom: in particular they tend to completely break the ability for it to associate errors with line numbers 2015-12-30T00:20:13Z arnaudga joined #lisp 2015-12-30T00:25:20Z quazimodo quit (Remote host closed the connection) 2015-12-30T00:25:20Z quazimod1 quit (Remote host closed the connection) 2015-12-30T00:25:36Z quazimodo joined #lisp 2015-12-30T00:28:35Z cmack joined #lisp 2015-12-30T00:32:11Z mishoo__ quit (Ping timeout: 265 seconds) 2015-12-30T00:33:04Z cmack quit (Ping timeout: 250 seconds) 2015-12-30T00:41:13Z rpg quit (Quit: rpg) 2015-12-30T00:42:01Z ebrasca` is now known as ebrasca 2015-12-30T00:45:17Z eazar001 quit (Quit: WeeChat 1.3) 2015-12-30T00:45:19Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T00:46:03Z arademaker left #lisp 2015-12-30T00:47:49Z urandom__ quit (Quit: Konversation terminated!) 2015-12-30T00:48:02Z eazar001 joined #lisp 2015-12-30T00:50:16Z lisse_ joined #lisp 2015-12-30T00:50:34Z lisse_ quit (Client Quit) 2015-12-30T00:52:52Z lisse_ joined #lisp 2015-12-30T00:58:58Z bcoburn_y joined #lisp 2015-12-30T01:00:08Z TDT joined #lisp 2015-12-30T01:00:24Z phoe_krk quit (Quit: http://phoe-krk.tumblr.com/) 2015-12-30T01:00:24Z mathi_aihtam quit (Quit: mathi_aihtam) 2015-12-30T01:05:11Z yuankode quit (Ping timeout: 246 seconds) 2015-12-30T01:05:39Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T01:16:10Z phoe_krk joined #lisp 2015-12-30T01:16:23Z arnaudga left #lisp 2015-12-30T01:18:44Z _sjs quit (Ping timeout: 276 seconds) 2015-12-30T01:21:02Z ACE_Recliner quit (Remote host closed the connection) 2015-12-30T01:22:13Z phoe_krk quit (Remote host closed the connection) 2015-12-30T01:22:36Z doesthiswork joined #lisp 2015-12-30T01:23:15Z doesthiswork: is "Exercices" on the CLiki misspelled on purpose? 2015-12-30T01:23:36Z phoe_krk joined #lisp 2015-12-30T01:23:58Z doesthiswork: or it might be in french 2015-12-30T01:24:35Z doesthiswork: ok nevermind 2015-12-30T01:29:17Z phoe_krk quit (Remote host closed the connection) 2015-12-30T01:29:36Z phoe_krk joined #lisp 2015-12-30T01:30:20Z sysfault quit (Ping timeout: 260 seconds) 2015-12-30T01:32:39Z kazlock: car and cdr seem like such simple/insignificant functions. Why is it that they are one of the first things you learn about it every book on functional programming languages? 2015-12-30T01:33:47Z sysfault joined #lisp 2015-12-30T01:34:27Z White_Flame: because composition & destructuring are the foundation of working with data structures? 2015-12-30T01:35:43Z phoe_krk: kazlock: because all of lisp is essentially made of car and cdr. and unless you understand that concept, you can't understand lisp. 2015-12-30T01:35:57Z phoe_krk quit (Quit: http://phoe-krk.tumblr.com/) 2015-12-30T01:36:21Z lisse_ joined #lisp 2015-12-30T01:37:21Z phoe_krk joined #lisp 2015-12-30T01:37:40Z ebrasca quit (Remote host closed the connection) 2015-12-30T01:37:49Z lisse_ quit (Client Quit) 2015-12-30T01:38:05Z kazlock: phoe_krk: Will that concept make sense as I progress through Practical Common Lisp? 2015-12-30T01:38:17Z phoe_krk: kazlock: absolutely yes. 2015-12-30T01:41:25Z phoe_krk quit (Client Quit) 2015-12-30T01:42:38Z White_Flame: basically, if you can put 2 things together into a cell, then you can put N things together in general, by holding cells within cells 2015-12-30T01:42:56Z phoe_krk joined #lisp 2015-12-30T01:43:31Z White_Flame: those 2 things happen to be called the car & cdr by historical convention 2015-12-30T01:43:37Z phoe_krk quit (Remote host closed the connection) 2015-12-30T01:44:18Z phoe_krk joined #lisp 2015-12-30T01:44:20Z kazlock: are car and cdr themselves used often? 2015-12-30T01:44:29Z kazlock: other than in the language implementation 2015-12-30T01:44:40Z phoe_krk: kazlock: yes, they are. 2015-12-30T01:44:40Z pjb: as often as you wish. 2015-12-30T01:44:56Z phoe_krk: Lisp itself is made of lists and you need some way of accessing elements of these lists. 2015-12-30T01:45:13Z phoe_krk: car and cdr are the two things that by themselves allow you access to any part of a list. 2015-12-30T01:45:25Z pjb: kazlock: the point is that CAR and CDR are older than Lisp. They were used in NSS and in Fortran. 2015-12-30T01:45:27Z FreeBirdLjj joined #lisp 2015-12-30T01:45:41Z pjb: kazlock: check http://www.informatimago.com/articles/flpl/ 2015-12-30T01:46:06Z phoe_krk: Also, anyone on the channel use stumpwm? I've been trying to fiddle with it and screwed up my Icedove that now runs in fullscreen without any window decoration! And I can't minimize it. ;_; 2015-12-30T01:46:40Z pjb: I would try (apropos "MINIATUR") or (apropos "ICONI") 2015-12-30T01:48:15Z sysfault quit (Ping timeout: 240 seconds) 2015-12-30T01:50:05Z pjb: kazlock: notice that with: (defun kons (a d) (lambda (s) (funcall s a d))) (defun kar (k) (if (null k) k (funcall k (lambda (a d) a)))) (defun kdr (k) (if (null k) k (funcall k (lambda (a d) d)))) you get cons car and cdr: (kar (kons 1 2 )) #| --> 1 |# (kdr (kons 1 2)) #| --> 2 |# (kar (kdr (kdr (kons 1 (kons 2 (kons 3 (kons 4 (kons 5 nil)))))))) #| --> 3 |# 2015-12-30T01:51:12Z pjb: kazlock: then you can just modify the printer to print (kons 1 2) as (1 . 2) instead of #, and (kons 1 (kons 2 nil)) as (1 2) instead of #. 2015-12-30T01:51:40Z pjb: kazlock: you would also need a way to implement konsp. 2015-12-30T01:53:11Z kazlock: its hard for me to read in irc client 2015-12-30T01:53:20Z bcoburn joined #lisp 2015-12-30T01:53:25Z pjb: Of course. copy and paste, insert newlines and M-q 2015-12-30T01:53:27Z phoe_krk: oh, I figured my thing out. Turns out it's an X11 fullscreen feature. 2015-12-30T01:53:36Z phoe_krk: Scary. 2015-12-30T01:53:53Z nyef: phoe_krk: You mean, you hit F11 or something? 2015-12-30T01:54:18Z bcoburn_y quit (Ping timeout: 272 seconds) 2015-12-30T01:54:28Z phoe_krk: nyef: yes, except that was in another window manager and Cinnamon didn't have a key bound to fullscreen-toggle by default. 2015-12-30T01:54:37Z nyef: Ah. 2015-12-30T01:54:37Z phoe_krk: So I had to bind it by myself. 2015-12-30T01:54:43Z phoe_krk: And undo the thing. 2015-12-30T01:54:51Z pwnie quit (Quit: = "") 2015-12-30T01:54:57Z kazlock: pjb: i wish that car and cons worked on strings 2015-12-30T01:55:08Z kazlock: that would make this function I'm doing much easier 2015-12-30T01:55:10Z phoe_krk: kazlock: strings aren't lists. they're arrays. 2015-12-30T01:55:21Z phoe_krk: But there are two functions you might consider useful. 2015-12-30T01:55:28Z phoe_krk: aref and subseq. 2015-12-30T01:55:40Z phoe_krk: (aref string 0) will give you the first character. 2015-12-30T01:55:46Z gmislata quit (Ping timeout: 272 seconds) 2015-12-30T01:55:49Z phoe_krk: (subseq string 1) will give you the string minus the first character. 2015-12-30T01:55:53Z phoe_krk: Unless I mixed the argument order. 2015-12-30T01:55:59Z blt quit (Ping timeout: 264 seconds) 2015-12-30T01:56:39Z White_Flame: you can also do (coerce "abcd" 'list) 2015-12-30T01:56:41Z phoe_krk: I think these two are equivalent to car and cdr when taking arrays/strings into account. 2015-12-30T01:57:02Z White_Flame: and coerce a list of characters back into 'string 2015-12-30T01:57:03Z phoe_krk: or what White_Flame said, as long as you're fine with coercing the final result back into a string. 2015-12-30T01:57:04Z gmislata joined #lisp 2015-12-30T01:57:05Z phoe_krk: ^ 2015-12-30T01:57:28Z White_Flame: certainly less efficient, but effective for learning 2015-12-30T01:57:36Z _sjs joined #lisp 2015-12-30T02:05:49Z resttime quit (Quit: ERC (IRC client for Emacs 24.5.1)) 2015-12-30T02:08:38Z sysfault joined #lisp 2015-12-30T02:08:38Z aap_ joined #lisp 2015-12-30T02:08:53Z zygentoma quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/) 2015-12-30T02:09:25Z Claud joined #lisp 2015-12-30T02:09:53Z \var quit (Quit: Leaving) 2015-12-30T02:10:20Z kazlock: Is this lispy? I'm very proud of it http://paste.lisp.org/display/304133 2015-12-30T02:11:45Z phoe_krk: I find it lispy enough 2015-12-30T02:11:46Z dreamaddict left #lisp 2015-12-30T02:11:59Z kazlock: oh i found a bug 2015-12-30T02:12:11Z aap quit (Ping timeout: 264 seconds) 2015-12-30T02:12:38Z anti-freeze quit (Remote host closed the connection) 2015-12-30T02:13:09Z doesthiswork: just glanceing it over it looks like you could take query and domain out of the argslist of do-search and it would work the same 2015-12-30T02:13:34Z kazlock: oh that's true 2015-12-30T02:16:26Z EvW quit (Ping timeout: 240 seconds) 2015-12-30T02:16:32Z kazlock: I was trying to do this iteratively earlier and it was a huge headache. I'm very happy with the recursive implentation 2015-12-30T02:18:39Z huza quit (Quit: WeeChat 0.3.8) 2015-12-30T02:18:45Z pwnie joined #lisp 2015-12-30T02:18:46Z doesthiswork: and it seems like it works 2015-12-30T02:18:57Z doesthiswork: what bug did you find? 2015-12-30T02:20:42Z kazlock: the final case in the condition should've set qi back to 0 2015-12-30T02:20:49Z kazlock: in the recursive call 2015-12-30T02:21:17Z kazlock: so (do-search "cat" "ca cat") would fail 2015-12-30T02:21:55Z doesthiswork: yes that is true 2015-12-30T02:22:46Z ajf- quit (Quit: Textual IRC Client: www.textualapp.com) 2015-12-30T02:22:51Z kazlock: Does this count as tail recursion? 2015-12-30T02:23:52Z doesthiswork: tail call elimination is not guarenteed 2015-12-30T02:24:09Z anti-freeze joined #lisp 2015-12-30T02:24:25Z anti-freeze quit (Remote host closed the connection) 2015-12-30T02:24:26Z White_Flame: also, your inner function is not local to my-serach; it's a global toplevel function 2015-12-30T02:24:50Z kazlock: What decides whether its local or global? 2015-12-30T02:24:53Z White_Flame: you can call defun inside other functions, and that will [re]define a function, doing so every time you call my-search 2015-12-30T02:25:10Z White_Flame: (flet ((funcname (params) ...) (funcname (params) ...)) ...body that uses functions) 2015-12-30T02:25:29Z White_Flame: s/flet/labels/ if they refer to each other 2015-12-30T02:25:50Z White_Flame: that's a function declaration that only exists within that body's scope 2015-12-30T02:25:53Z anti-freeze joined #lisp 2015-12-30T02:29:26Z cmack joined #lisp 2015-12-30T02:31:23Z blub: your recursive calls are all tail calls yes 2015-12-30T02:31:42Z blub: your docstring doesn't match the arglist 2015-12-30T02:34:04Z phoe_krk quit (Quit: http://phoe-krk.tumblr.com/) 2015-12-30T02:34:30Z cmack quit (Ping timeout: 260 seconds) 2015-12-30T02:34:59Z Nikotiini quit (Remote host closed the connection) 2015-12-30T02:37:41Z prxq_ joined #lisp 2015-12-30T02:41:15Z prxq quit (Ping timeout: 260 seconds) 2015-12-30T02:43:56Z fsmunoz quit (Ping timeout: 250 seconds) 2015-12-30T02:46:52Z kazlock: White_Flame: TIL about flet. ty 2015-12-30T02:47:13Z White_Flame: flet has a more understandable name, but LABELS is certainly preferred by default 2015-12-30T02:47:51Z Karl_Dscc joined #lisp 2015-12-30T02:48:13Z White_Flame: since flet function bodies can't see the functions being defined, whereas labels can 2015-12-30T02:49:11Z kazlock: so (flet ((foo () ...) (bar () (foo)))) would fail? 2015-12-30T02:49:17Z White_Flame: yes 2015-12-30T02:49:26Z kazlock: that's good to know 2015-12-30T02:49:27Z White_Flame: labels has the exact same syntax, and would work 2015-12-30T02:49:56Z White_Flame: but labels is a dumb name, and just like there's let and let*, it should probably be flet and flet* instead. But that argument is a few decades too late ;) 2015-12-30T02:49:59Z blt joined #lisp 2015-12-30T02:50:08Z kazlock: that's what I was going to say 2015-12-30T02:50:37Z kazlock: i say to hell with all the old code, s/labels/flet*/ 2015-12-30T02:51:08Z White_Flame: (defmacro flet* (&rest rest) `(labels ,@rest)) 2015-12-30T02:51:28Z kazlock: woah cool 2015-12-30T02:51:39Z kazlock: #define labels flet* 2015-12-30T02:51:52Z White_Flame sets mode +b kazlock 2015-12-30T02:51:52Z TDT quit (Quit: TDT) 2015-12-30T02:52:06Z kazlock: +b? 2015-12-30T02:52:12Z White_Flame: BAN ;) 2015-12-30T02:52:15Z kazlock: hahahaha 2015-12-30T02:52:33Z kazlock: except flet* is an invalid name in c, so lisp is still superior ;) 2015-12-30T02:53:17Z White_Flame: and really, it should probably be (define-symbol-macro flet* 'labels) 2015-12-30T02:53:30Z defaultxr joined #lisp 2015-12-30T02:54:12Z smokeink joined #lisp 2015-12-30T02:55:21Z Bicyclidine: symbol macros aren't expanded in the first position 2015-12-30T02:55:39Z White_Flame: ok, was reading the spec on that. I knew there was a gotcha somewhere 2015-12-30T02:55:52Z White_Flame: I think I've only used symbol macros once, if that 2015-12-30T02:56:22Z loke: White_Flame: They are useful, but generall yonly as part of macros 2015-12-30T02:56:57Z Karl_Dscc quit (Remote host closed the connection) 2015-12-30T02:57:40Z loke: Here's my only use of it that I can think of: https://github.com/cicakhq/potato/blob/master/src/common/common.lisp#L24 2015-12-30T03:08:04Z Guest20317 quit (Ping timeout: 245 seconds) 2015-12-30T03:10:31Z nicdev joined #lisp 2015-12-30T03:11:41Z arescorpio joined #lisp 2015-12-30T03:11:43Z anti-freeze quit (Remote host closed the connection) 2015-12-30T03:13:00Z yrk quit (Ping timeout: 260 seconds) 2015-12-30T03:14:08Z kazlock: How can you tell if sbcl is applying tailrecursion to your function? 2015-12-30T03:14:51Z Bicyclidine: stack doesn't overflow 2015-12-30T03:15:17Z Bicyclidine: also http://www.sbcl.org/manual/#Debug-Tail-Recursion 2015-12-30T03:19:14Z yeticry quit (Read error: Connection reset by peer) 2015-12-30T03:19:56Z yeticry joined #lisp 2015-12-30T03:26:27Z cmatei quit (Read error: Connection reset by peer) 2015-12-30T03:27:15Z loke: kazlock: You can't. 2015-12-30T03:27:27Z loke: kazlock: Well, not in a generic way except by looking at the disassembly. 2015-12-30T03:27:54Z kazlock: is stackoverflow a common concern in lisp? 2015-12-30T03:27:57Z loke: kazlock: You should never rely on it anyway. Rail call elimination is unpredictable. 2015-12-30T03:28:27Z bb010g joined #lisp 2015-12-30T03:28:42Z loke: kazlock: Well, the spec explicitly states that you can never rely on tail call elimination, and developers don't generally write iteration as recursion. 2015-12-30T03:30:05Z kazlock: loke: its so tempting to use tail recursion sometimes because its much cleaner 2015-12-30T03:30:49Z loke: kazlock: Matter of taste. In CL you just shouldn't. 2015-12-30T03:31:20Z loke: (personally, I find tail recursive code to be ugly as sin compared to LOOP, but I respect people's differing opinion) 2015-12-30T03:31:44Z kazlock: loke: you think this could be done more cleanly with LOOP? http://paste.lisp.org/display/304133#3 2015-12-30T03:32:02Z loke: Yes. 2015-12-30T03:32:02Z fluter quit (Ping timeout: 250 seconds) 2015-12-30T03:33:08Z loke: Actually, if I read this right, you can replace it with a single call to SEARCH 2015-12-30T03:33:10Z warweasle quit (Read error: Connection reset by peer) 2015-12-30T03:34:03Z kazlock: loke: I was implementing search as an exercise 2015-12-30T03:34:11Z loke: Fair enough 2015-12-30T03:34:26Z loke: OK, I'll give it a shot using LOOP. As an excersise :-) 2015-12-30T03:34:33Z kazlock: :-) ty 2015-12-30T03:35:04Z gmislata quit (Ping timeout: 250 seconds) 2015-12-30T03:36:28Z blub: kazlock: numbers may or may not be eq to themselves, you want eql or = 2015-12-30T03:36:35Z scymtym quit (Ping timeout: 255 seconds) 2015-12-30T03:36:43Z gmislata joined #lisp 2015-12-30T03:37:29Z kazlock: blub: Oh yes I remember reading that now. eq only works if the numbers are primitives? 2015-12-30T03:38:16Z loke: kazlock: Not even. It's undefined for numbers. 2015-12-30T03:38:24Z loke: Hmm, perhaps not for FIXNUM 2015-12-30T03:38:41Z blub: eq tests object identity, implementations are allowed to make copies of numbers and characters whenever they want, so testing object identity on them isn't reliable 2015-12-30T03:38:56Z blub: (eq 1 1) and (let ((x 1)) (eq x x)) could both be true or false 2015-12-30T03:39:36Z kazlock: blub: Object identity meaning that they refer to the same bits? 2015-12-30T03:39:44Z blub: right 2015-12-30T03:40:30Z harper joined #lisp 2015-12-30T03:40:40Z harper: Does lisp use templates 2015-12-30T03:40:56Z loke: harper: What do you mean by templates? 2015-12-30T03:41:04Z kazlock: as in c++ templates? 2015-12-30T03:41:10Z harper: yeah 2015-12-30T03:41:43Z loke: harper: C++ templates is a very poor substitute for Lisp macros. 2015-12-30T03:41:51Z beach: Good morning everyone! 2015-12-30T03:42:06Z kazlock: good morning beach! 2015-12-30T03:42:15Z blub: hi beach 2015-12-30T03:43:49Z beach: harper: Why the question? 2015-12-30T03:44:27Z harper: I am looking for a way to use templates or macros 2015-12-30T03:44:43Z kazlock: loke: I'm not sure that macros accomplish the same thing templates try to. I would say that since lisp is dynamically typed it doesn't need templates 2015-12-30T03:45:27Z beach: harper: That is a strange thing to want to do, unless you have an actual problem to solve, in which case there might be better ways of solving it. 2015-12-30T03:45:33Z harper: lisp can be static typed 2015-12-30T03:46:15Z fluter joined #lisp 2015-12-30T03:46:23Z beach: harper: Common Lisp (which is the topic of this channel) is a dynamically-typed programming language. Most implementations do compile-time type inference when possible, though. 2015-12-30T03:46:24Z jsgrant: "C++ templates are to common lisp macros, what IRS tax forms are to poetry." - drmeister 2015-12-30T03:46:44Z loke: kazlock: I did this... 2015-12-30T03:46:48Z loke: http://paste.lisp.org/display/304133#5 2015-12-30T03:46:57Z oleo__ joined #lisp 2015-12-30T03:47:03Z loke: Them I realised that I wasn't thinking right. and it won't match "foo" "ffoo" 2015-12-30T03:48:26Z learning joined #lisp 2015-12-30T03:49:19Z oleo_ quit (Ping timeout: 245 seconds) 2015-12-30T03:50:29Z IPmonger joined #lisp 2015-12-30T03:50:33Z IPmonger left #lisp 2015-12-30T03:50:38Z harper: what is the best lisp to start learning 2015-12-30T03:50:52Z loke: harish_: SBCL 2015-12-30T03:51:01Z loke: Just go with it straight away. 2015-12-30T03:51:14Z jsgrant: harper: Define best. Also, keep into consideration that this is a CL channel, not a general lisp chan. 2015-12-30T03:51:39Z loke: "general lisp" is such a fuzzy term that it borders on being completely useless. 2015-12-30T03:51:41Z beach: harper: Are you trying to choose between dialects of Lisp or implementations of Common Lisp.h? 2015-12-30T03:51:53Z IPmonger joined #lisp 2015-12-30T03:52:09Z jsgrant: loke_: Any and all Lisp-like langs, not exclusively CL.* ? 2015-12-30T03:52:14Z harper: I just want to learn a lisp 2015-12-30T03:52:26Z jsgrant: harper: Lisp, as in CL? 2015-12-30T03:52:38Z beach: jsgrant: It appears he doesn't know. 2015-12-30T03:52:38Z harper: sure 2015-12-30T03:52:50Z jsgrant: SBCL is the best FOSS Implementation I've seen. 2015-12-30T03:53:00Z jsgrant: beach: True. 2015-12-30T03:53:35Z small-wolf joined #lisp 2015-12-30T03:53:37Z small-wolf quit (Client Quit) 2015-12-30T03:53:44Z loke: jsgrant: My point is that if you use the term "Lisp" to refer to Common Lisp, then great. It's a useful thing. If you try to use the term "Lisp" to refer to anything vaguely lisp-like, then the term loses all meaning since the internal differences between lisp-like languages are greater than any Lisp-like language and, say, Haskell. 2015-12-30T03:54:06Z small-wolf joined #lisp 2015-12-30T03:54:34Z loke: Especially since Common Lisp is the only major Lisp-like language with "Lisp" in its name. :-) 2015-12-30T03:54:37Z jsgrant: loke: So, then what, is it suggested I refer to "all of it" as "lisp-like" langs? 2015-12-30T03:55:03Z jsgrant: Not trying to come off as sarcastic/snarky, if the following did.* 2015-12-30T03:55:23Z loke: jsgrant: Yes. Because if you just use "lisp" the better part of the audience will assume you're referring to are referring to Common Lisp anyway (unless you're talking about Lisp in a historical context of course) 2015-12-30T03:55:34Z joneshf-laptop quit (Ping timeout: 245 seconds) 2015-12-30T03:55:54Z small-wolf: Is there a built in way to get recursively print fields of a CLOS object? (like how structs print) 2015-12-30T03:56:23Z harper: inst common lisp the only dialect still in use. 2015-12-30T03:57:01Z loke: So in the interest of clarity and meaningfulness, it's better to focus on what you are actually talking about. I.e. someone might want to learn functional programming. He shouldn't ask "what lisp should I learn" but rather "what functional language should I learn", since Scheme (arguably a lisp) is functional but Common Lisp is not. But Haskell is, which is not even remotely lisp-like. 2015-12-30T03:57:18Z loke: small-wolf: No. Not built-in. 2015-12-30T03:57:18Z beach: harper: That is off topic, since this channel is dedicated to Common Lisp. Furthermore, since there is no general agreement about what languages are "dialects of Lisp", there is not going to be a general answer. 2015-12-30T03:57:27Z kazlock: loke: mine failes on "foo" "ffoo" as well.. 2015-12-30T03:57:45Z beach: harper: Most Common Lisp programmers would say that Emacs Lisp is close to Common Lisp and still very much in use. 2015-12-30T03:58:12Z loke: beach: Damn it. I keep forgetting about Elisp when I do these rants :-) 2015-12-30T03:58:14Z Oladon joined #lisp 2015-12-30T03:58:18Z loke: beach: You are right of course. 2015-12-30T03:58:31Z White_Flame: harper: install SBCL, emacs, and SLIME. if you're on a mac, probably install CCL (clozure cl) instead of sbcl 2015-12-30T03:58:43Z harper: I use linux 2015-12-30T03:58:49Z White_Flame: If you're on linux, all should be available from your package manager 2015-12-30T03:59:01Z loke uses SBCL on OSX quite happily. But yeah, you have to build it yourself. 2015-12-30T03:59:07Z jsgrant: beach: That maclisp heritage, largely though is why Elisp and CL is fairly similar, no? 2015-12-30T03:59:11Z White_Flame: from there, the book Practical Common Lisp is recommended to learn 2015-12-30T03:59:11Z small-wolf: sbcl is on brew 2015-12-30T03:59:17Z beach: loke: Still, I agree with out that there is no general agreement about what "lisp-like" might be. 2015-12-30T03:59:18Z White_Flame: minion: tell harper about pcl 2015-12-30T03:59:18Z minion: harper: please look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005). 2015-12-30T03:59:44Z loke: beach: Other than the parenthesis, no. And that distinction is so lose it's pointless. 2015-12-30T03:59:51Z loke: I mean loose 2015-12-30T04:00:43Z beach: loke: Worse, some people claim that some languages without this syntax are "Lisp"s and some people claim that Scheme is "a Lisp". 2015-12-30T04:01:03Z beach: loke: So not even the syntax can be relied upon as an indicator. 2015-12-30T04:01:18Z lisse_ joined #lisp 2015-12-30T04:01:30Z small-wolf: Is there a way to get a list of the accessible slots for an arbitrary object? (and is there a notion of access control for slots?) 2015-12-30T04:01:30Z loke: beach: If you listen to WJ, then Ruby is a lisp :-) 2015-12-30T04:01:34Z White_Flame: "code as data" is generally a strong indicator of lispiness, which most languages claiming lisp influence fail at 2015-12-30T04:01:35Z joneshf-laptop joined #lisp 2015-12-30T04:01:40Z beach: jsgrant: Yes, correct. 2015-12-30T04:01:42Z loke: small-wolf: yes 2015-12-30T04:01:44Z harper: ruby is dying 2015-12-30T04:01:46Z gko: also REPL 2015-12-30T04:01:49Z loke: small-wolf: Using MOP 2015-12-30T04:01:54Z beach: loke: Exactly! 2015-12-30T04:02:04Z beach: loke: Pretty soon, C++ will be "a Lisp" as well. :) 2015-12-30T04:02:20Z harper: 2017 will improve C++ 2015-12-30T04:02:50Z loke: harper: C++ hasn't been improved since the 80's, so I kinda doubt it. 2015-12-30T04:02:51Z beach: harper: That's what I said. 2015-12-30T04:04:10Z White_Flame: It will certainly expand C++. Whether or not it's an improvement is to be seen ;) 2015-12-30T04:04:14Z pjb: kazlock: you don't need templates in lisp because we have generic functions: (defun f (x) (if (< x 1) 1 (* x (f (1- x))))) #| --> f |# (list (f 4) (f 5/2) (f 4.2)) #| --> (24 15/4 35.481586) |# 2015-12-30T04:04:18Z loke: small-wolf: Load the QL package "closer-mop" and then you can call (CLOSER-MOP:CLASS-SLOTS ...) 2015-12-30T04:04:53Z small-wolf: loke: So is MOP a standard defined by some non-ANSI group of which there are several implementations? 2015-12-30T04:04:59Z Petit_Dejeuner joined #lisp 2015-12-30T04:05:05Z pjb: kazlock: notice how the list is a list of an integer, a ratio, a float. In C++ you would have to use templates, have 3 different lists, or a list, etc. 2015-12-30T04:05:23Z gmislata quit (Ping timeout: 255 seconds) 2015-12-30T04:05:27Z beach: small-wolf: Pretty much, yes. 2015-12-30T04:05:49Z beach: small-wolf: But Closer-MOP makes them look similar. 2015-12-30T04:05:52Z loke: small-wolf: The MOP was excluded from the ANSI spec for time constraints (I think). All CL's that I know of implement it though, but ever so slightly different (for example, different package names). Closer-mop simply brings it all together using the same API and package. 2015-12-30T04:05:59Z mlrutherford is now known as mlr|dreaming 2015-12-30T04:06:22Z Petit_Dejeuner: "notice how the list is a list of an integer, a ratio, a float" ...a Haskell programmer is frothing at the mouth somewhere right now. 2015-12-30T04:06:43Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T04:06:48Z loke: Petit_Dejeuner: How would a Haskell programmer do it? (i'm not very familiar with haskell) 2015-12-30T04:06:56Z loke: Petit_Dejeuner: Is that an Option or a Maybe? 2015-12-30T04:06:58Z small-wolf: Petit_Dejeuner: Data.Dynamic? 2015-12-30T04:07:08Z White_Flame: "a Haskell programmer frothing at the mouth" is a tautology ;) 2015-12-30T04:07:10Z harper: I'd rather use nim or rust for that 2015-12-30T04:07:12Z small-wolf: or is it Data.Typeable 2015-12-30T04:07:13Z Petit_Dejeuner: White_Flame: lol 2015-12-30T04:07:14Z gmislata joined #lisp 2015-12-30T04:07:21Z AntiSpamMeta quit (Remote host closed the connection) 2015-12-30T04:07:27Z pjb: beach: C++ is already a lisp : http://www.informatimago.com/articles/life-saver.html#sexp :-) 2015-12-30T04:07:41Z small-wolf: You can get type-safe heterogeneous containers in Haskell, it's just a pain in the ass 2015-12-30T04:07:44Z AntiSpamMeta joined #lisp 2015-12-30T04:07:50Z Petit_Dejeuner: loke, small-wolf, it would depend on the problem, but they'd specify the types 2015-12-30T04:08:33Z pjb: All lisp objects are a kind of maybe thing, with (type-of object) (null object) etc. 2015-12-30T04:08:52Z Petit_Dejeuner: All Java objects are a type of maybe thing too. 2015-12-30T04:08:59Z Petit_Dejeuner: ListOrNull 2015-12-30T04:09:12Z Petit_Dejeuner: VectorOrNull 2015-12-30T04:09:20Z harper: OO in C++ feels tacked on 2015-12-30T04:09:48Z Petit_Dejeuner: Lisp gets away with it because A) Lisp is dynamic so nobody cares B) Nil can be used in method dispatch 2015-12-30T04:09:52Z White_Flame: Petit_Dejeuner: the newer java versions now auto-box primitive int/char/long/etc? 2015-12-30T04:10:16Z White_Flame: harper: that's kind of what the "++" implies 2015-12-30T04:10:28Z learning: loke: who is wj? 2015-12-30T04:10:29Z Petit_Dejeuner: White_Flame: You mean autobox as in convert between Integer and int automagically? 2015-12-30T04:10:30Z loke: harper: That's because it _is_ tacked on :-) 2015-12-30T04:10:34Z White_Flame: Petit_Dejeuner: yes 2015-12-30T04:10:39Z Petit_Dejeuner: Yes. 2015-12-30T04:10:41Z loke: learning: If you don't know. Count yourself lucky. 2015-12-30T04:10:58Z loke: learning: If you _really_ want to know, read comp.lang.lisp 2015-12-30T04:11:02Z lisse_ joined #lisp 2015-12-30T04:12:23Z White_Flame: also, see the 3rd paragraph for a list of what characterizes Lisp: www-formal.stanford.edu/jmc/history/lisp/node1.html 2015-12-30T04:12:36Z White_Flame: http://www-formal.stanford.edu/jmc/history/lisp/node1.html 2015-12-30T04:14:13Z small-wolf quit (Ping timeout: 252 seconds) 2015-12-30T04:14:15Z doesthiswork quit (Quit: Page closed) 2015-12-30T04:15:43Z small-wolf joined #lisp 2015-12-30T04:16:51Z loke: White_Flame: Note that that paragraph was written 20 years ago. Things have changed a bit since. 2015-12-30T04:17:02Z White_Flame: right, but it's written in a general sense 2015-12-30T04:17:38Z White_Flame: many of the statements have been adopted widely and are common, but things like "the representation of Lisp programs as Lisp data" I believe is still distinctive 2015-12-30T04:18:05Z kazlock: loke: Here's a nice article supporting your thoughts on tail recursion http://neopythonic.blogspot.com/2009/04/tail-recursion-elimination.html 2015-12-30T04:18:06Z loke: White_Flame: Yes. I can agree with that statement. 2015-12-30T04:18:38Z White_Flame: also it was written in 1979, and exported in 96, so more like 36 years ago :) 2015-12-30T04:19:56Z loke: kazlock: My primary argument as to why not including tail call elimination is CL is that of macros though. Imaging function FOO: (defun foo (x) (let ((z x)) (do-something z))) 2015-12-30T04:20:14Z loke: kazlock: now this seems to be a pretty clear-cut tail-call 2015-12-30T04:20:21Z loke: kazlock: now change it to this: 2015-12-30T04:20:50Z loke: (defun foo (x) (bind ((z x)) (do-something z))) 2015-12-30T04:21:12Z loke: Is do-something still in a tail position? You don't know unless you know the implementation of BIND 2015-12-30T04:21:40Z Bicyclidine: i mean... you do know the implementation of bind, you're the compiler, you can just macroexpand 2015-12-30T04:21:45Z Bicyclidine: it's not like scheme doesn't have macros 2015-12-30T04:21:46Z loke: With macros, it's incredibly easy to inadvertantly add something that brings the final call out of the tail position. 2015-12-30T04:21:55Z kazlock: ah that's true 2015-12-30T04:22:07Z Petit_Dejeuner: Would that happen in practice though? 2015-12-30T04:22:24Z Bicyclidine: more inconvenient is having (declaim (special z)) somewhere 2015-12-30T04:22:25Z kazlock: I could see it happening 2015-12-30T04:22:46Z loke: Now, _IF_ I had been inon the comittee, and _IF_ they had decided to include tail-calls, I would have demanded that they make tail call explicit. Kinda like the way Clojure does it with the "recur" call. 2015-12-30T04:24:10Z Petit_Dejeuner would just use trace for debugging 2015-12-30T04:24:13Z small-wolf: loke: so no mutual recursion then? 2015-12-30T04:24:30Z loke: small-wolf: You could still have that even with explicit recursion 2015-12-30T04:25:19Z loke: In my case, the recur form would simply be a marker that tells the compiler to ensure it's in a tail-call position, or give an error. In order to prevent errors where your tail call isn't actually in tail position. 2015-12-30T04:25:52Z loke: As much as I dislike val Rossum and find him to be incompetent, I have to agree with him on his opinions on tail calls. 2015-12-30T04:26:15Z smokeink quit (Ping timeout: 260 seconds) 2015-12-30T04:26:43Z pwnie quit (Quit: = "") 2015-12-30T04:26:44Z xrash joined #lisp 2015-12-30T04:27:17Z kazlock: loke: I think I know what's wrong with our search impls. Here's what's happening where the capital letters denote m and i respectively (Foo Ffoo) (fOo fFoo) (Foo ffOo) ... 2015-12-30T04:27:34Z loke: kazlock: I know exactly what went wrong. :-) 2015-12-30T04:27:43Z kazlock: oh i didn't haha 2015-12-30T04:27:46Z loke: kazlock: I just don't want to think about trying to fix it :-) 2015-12-30T04:28:06Z kazlock: if m > 0 don't increment i on a mismatch 2015-12-30T04:28:10Z loke: I mean, it's easy to fix, but at O(n^2) 2015-12-30T04:28:34Z loke: Actually, only O(n^2) in the absolute worst-case 2015-12-30T04:28:38Z kazlock: it would still be O(n) 2015-12-30T04:28:48Z l04m33 quit (Ping timeout: 250 seconds) 2015-12-30T04:28:51Z loke: Point is, you have to backtrack on mismatch 2015-12-30T04:29:01Z badkins quit (Remote host closed the connection) 2015-12-30T04:29:05Z kazlock: a constant amount of times though 2015-12-30T04:29:08Z kazlock: worst case is 2n 2015-12-30T04:29:10Z loke: Actually, it would be O(n*m) 2015-12-30T04:29:14Z jeti quit (Ping timeout: 246 seconds) 2015-12-30T04:29:19Z kazlock: ohh 2015-12-30T04:29:22Z loke: or am I confused? 2015-12-30T04:29:28Z kazlock: no I am confused actually 2015-12-30T04:29:35Z kazlock: wait maybe I'm not confused 2015-12-30T04:29:53Z loke: n is the length of the search string, m is the length of the query string 2015-12-30T04:29:57Z kazlock: I don't think you have to backtrack on a mismatch 2015-12-30T04:30:16Z cmack joined #lisp 2015-12-30T04:30:22Z loke: so as m and n tends to ∞, it should be O(n*m) 2015-12-30T04:30:28Z kazlock: You can reset m and leave i 2015-12-30T04:30:43Z loke: Well, with my solution it would. Which is why I said O(n*m). I know it can be improved much. 2015-12-30T04:31:02Z loke: kazlock: No, you can't actually. That's what I am doing after all. 2015-12-30T04:31:48Z loke: imagine "aaaaaax" in "aaaaaaaaaaaaaaax" 2015-12-30T04:32:55Z small-wolf quit (Ping timeout: 252 seconds) 2015-12-30T04:34:38Z arescorpio quit (Quit: Leaving.) 2015-12-30T04:35:14Z kazlock: oh I see now 2015-12-30T04:35:15Z cmack quit (Ping timeout: 260 seconds) 2015-12-30T04:37:07Z small-wolf joined #lisp 2015-12-30T04:37:18Z eazar001 quit (Ping timeout: 256 seconds) 2015-12-30T04:38:45Z earl-ducaine quit (Ping timeout: 260 seconds) 2015-12-30T04:40:39Z IPmonger left #lisp 2015-12-30T04:41:26Z karswell joined #lisp 2015-12-30T04:41:46Z kobain quit (Ping timeout: 240 seconds) 2015-12-30T04:43:08Z kazlock: loke: an O(n) method is to build a suffix array of every substring of length (length query) and try and match query to one of them 2015-12-30T04:43:10Z mlr|dreaming is now known as mlrutherford 2015-12-30T04:43:39Z loke: kazlock: Yes, but that's only useful for large strings where you do multiple matches over that string. 2015-12-30T04:44:09Z loke: Because the construction of the suffix array itself is O(n*log n) 2015-12-30T04:44:22Z loke: (I think) 2015-12-30T04:45:43Z kazlock: actually now that I think about it, you don't need a suffix array, you could just do (= query (subseq i (+ i (length query)))) 2015-12-30T04:46:04Z kazlock: (= query (subseq str (+ i (length query)))) 2015-12-30T04:46:05Z kazlock: typo 2015-12-30T04:46:44Z kazlock: is that n*m though... yes 2015-12-30T04:47:13Z Bicyclidine: are you just doing string searching, or what? 2015-12-30T04:47:27Z kazlock: Bicyclidine: yes, its harder than I thought at first 2015-12-30T04:47:34Z loke: Bicyclidine: yes, buit the purpose wasn't to create an efficient search :-) 2015-12-30T04:47:57Z loke: You could just go ahead and reimplement the BM algorithm and be done with it :-) 2015-12-30T04:48:04Z Bicyclidine: just kind of weird seeing O times, i mean... basically that, yeah. 2015-12-30T04:48:04Z chu quit (Quit: leaving) 2015-12-30T04:48:37Z chu joined #lisp 2015-12-30T04:48:40Z loke: BM is O(n+m) 2015-12-30T04:48:43Z learning quit (Remote host closed the connection) 2015-12-30T04:49:03Z loke: Oh wait, It's O(n*m) 2015-12-30T04:49:12Z loke: it's O(n+m) for non-matches 2015-12-30T04:51:06Z chu quit (Client Quit) 2015-12-30T04:51:31Z chu joined #lisp 2015-12-30T04:52:37Z smokeink joined #lisp 2015-12-30T04:53:39Z chu quit (Client Quit) 2015-12-30T04:53:52Z loke: Hmm, seems like SBCL implementation of SEARCH does not use boyer-moore but rather the naïve implementation. 2015-12-30T04:54:06Z chu joined #lisp 2015-12-30T05:00:33Z beach: loke: Write a better one, do some benchmarking on other implementations as well, write a paper about it, submit the paper to ELS, make your employer pay your trip to Krakow. 2015-12-30T05:01:58Z loke: I'm actually looking at the possibility to do MB for SEARCH across vectors in SBCL right now. 2015-12-30T05:02:34Z learning joined #lisp 2015-12-30T05:04:45Z Bicyclidine: keys are positions, test, key, and from-end. can't be that hard. i wonder why it doesn't. other than that search isn't used very much in my experience 2015-12-30T05:05:16Z eazar001 joined #lisp 2015-12-30T05:08:13Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T05:09:57Z l04m33 joined #lisp 2015-12-30T05:10:59Z OrangeShark quit (Quit: Leaving) 2015-12-30T05:11:05Z mlrutherford is now known as mlr|dreaming 2015-12-30T05:14:57Z psy_ quit (Remote host closed the connection) 2015-12-30T05:16:08Z nyef: If you're going to mess with SEARCH, make sure that there are good test cases for it in the test suite. (-: 2015-12-30T05:16:12Z Claud quit (Quit: Page closed) 2015-12-30T05:16:59Z small-wolf quit (Ping timeout: 264 seconds) 2015-12-30T05:17:22Z mbuf joined #lisp 2015-12-30T05:20:17Z learning quit 2015-12-30T05:20:18Z kazlock: loke: where did you find the search implementation in the sbcl source? 2015-12-30T05:23:01Z loke: Which one? There are multiple :-) 2015-12-30T05:23:10Z loke: The open-coded one is in seqtran.lisp 2015-12-30T05:23:32Z loke: Look for "deftransform search" 2015-12-30T05:25:42Z Oladon quit (Quit: Leaving.) 2015-12-30T05:25:53Z small-wolf joined #lisp 2015-12-30T05:26:53Z earl-ducaine joined #lisp 2015-12-30T05:26:54Z AntiSpamMeta quit (Read error: Connection reset by peer) 2015-12-30T05:27:41Z AntiSpamMeta joined #lisp 2015-12-30T05:27:42Z kazlock: wait the sbcl compiler is written in lisp...? 2015-12-30T05:27:50Z loke: kazlock: Yes. 2015-12-30T05:27:57Z kazlock: common lisp is written in common lisp 2015-12-30T05:28:37Z loke: Most languages are implemented in itself. 2015-12-30T05:28:40Z White_Flame: and you can even change the compiler at runtime, to support different CPU instructions or configure low level optimizations etc 2015-12-30T05:28:47Z loke: Well, not sure about most, but "many" 2015-12-30T05:29:14Z kazlock: that's like saying I'm my own father 2015-12-30T05:29:18Z kazlock: ... ew 2015-12-30T05:29:26Z zbigniew quit (Ping timeout: 256 seconds) 2015-12-30T05:29:40Z White_Flame: if you're coming from C, what do you think C compilers are written in? :) 2015-12-30T05:29:42Z zbigniew joined #lisp 2015-12-30T05:30:04Z fe[nl]ix: loke: I think for most languages the compilers are written in C/C++ 2015-12-30T05:30:19Z kazlock: BCPL 2015-12-30T05:30:26Z small-wolf quit (Ping timeout: 255 seconds) 2015-12-30T05:30:36Z kazlock: https://en.wikipedia.org/wiki/BCPL 2015-12-30T05:30:55Z harper quit (Ping timeout: 240 seconds) 2015-12-30T05:31:00Z loke: fenlix: Well, perhaps. But if you narrow it down to "languages that are capable to generating native code", I think most of _those_ are self-hosting. 2015-12-30T05:32:30Z loke: kazlock: if you look at, say, src/compiler/x86-64/move.lisp you'll see that even the code generator is written in Lisp. 2015-12-30T05:33:01Z kdas_ quit (Quit: Leaving) 2015-12-30T05:33:03Z kazlock: yes but how was move.lisp compiled 2015-12-30T05:33:27Z loke: The cool thing is that you can use DEFINE-VOP to define your own assembly "macros" 2015-12-30T05:33:28Z kushal joined #lisp 2015-12-30T05:33:50Z bugrum quit (Remote host closed the connection) 2015-12-30T05:34:00Z mathi_aihtam joined #lisp 2015-12-30T05:34:13Z mathi_aihtam quit (Client Quit) 2015-12-30T05:34:22Z loke: kazlock: It was compiled by the bootstrapping Lisp compiler. 2015-12-30T05:34:27Z loke: kazlock: You don' 2015-12-30T05:34:31Z White_Flame: kazlock: nobody uses BCPL; C compilers are written in C 2015-12-30T05:34:52Z loke: kazlock: You don't have to use SBCL to compile SBCL. You can bootstrap it using ABCL, CCL or some other Common Lisp. 2015-12-30T05:35:04Z eazar001 quit (Quit: WeeChat 1.3) 2015-12-30T05:35:23Z loke: But normally you compile SBCL with SBCL. 2015-12-30T05:35:37Z kazlock: so sbcl doesn't compile itself, its compiled by another lisp implementation which already exists 2015-12-30T05:35:44Z kazlock: oh 2015-12-30T05:35:53Z White_Flame: some other lisp runs the SBCL code, and the SBCL code compiles SBCL 2015-12-30T05:36:23Z loke: White_Flame: That's for bootstrapping only. Once you have an SBCL, you use it to compile more SBCL :-) 2015-12-30T05:36:30Z White_Flame: right 2015-12-30T05:36:37Z kazlock: so if I want to create a new language called K, I just come up with a specification, write a compiler in K that follows the specificiation, and then... ? 2015-12-30T05:36:52Z eazar001 joined #lisp 2015-12-30T05:36:55Z loke: kazlock: There is already a language called K 2015-12-30T05:36:57Z kazlock: what is bootstrapping? 2015-12-30T05:36:59Z Bicyclidine: compile it by hand, obviously, and then fight a bear 2015-12-30T05:37:00Z nyef: kazlock: There's a discussion of this kind of bootstrapping in the back of the "Dragon Book". 2015-12-30T05:37:23Z eazar001 quit (Client Quit) 2015-12-30T05:37:32Z loke: kazlock: Bootstrapping is a term that describes the process of betting a running system (operating system, compile toolchain, etc) from "nothing". 2015-12-30T05:37:53Z White_Flame: "pull yourself up by the bootstraps" 2015-12-30T05:38:13Z kazlock: its starts with handwritten machine code, no? 2015-12-30T05:38:24Z loke: I believe the first Pascal compiler was written in Pascan even before Pascal existed. It was bootstrapped by compiling the compiler to assembly BY HAND... then the resulting compiler was used to compile the compiler. 2015-12-30T05:38:50Z kazlock: ooh that's cool 2015-12-30T05:39:44Z kazlock: debugging must have been fun 2015-12-30T05:41:03Z loke: Back in those days, people were used to manual debugging by reading raw hexdumps. 2015-12-30T05:41:10Z loke: We're so much weaker these days. 2015-12-30T05:41:58Z Bicyclidine: plus we have better things to do with our time, like cookie clicker. might as well just write a bootstrap compiler in python or whatever and work your way up 2015-12-30T05:42:30Z White_Flame: there's a great story of bringing the Commodore 128 to demo at a convention. There was a change to the hardware, so the CP/M guy had to update some driver code en route, doing so via a raw disk sector editor 2015-12-30T05:43:49Z loke: White_Flame: Such a waste of time. No one used CP/M on the C128. The only command people typed on them was gp64 2015-12-30T05:43:53Z loke: I mean go64 2015-12-30T05:44:07Z White_Flame: yeah, but it was a marketing point 2015-12-30T05:44:12Z loke: Fair enough 2015-12-30T05:44:33Z loke: I still remember the "three computers in one" marketing 2015-12-30T05:45:59Z jsgrant quit (Remote host closed the connection) 2015-12-30T05:46:33Z loke: All right. I'm going for some lunch now. 2015-12-30T05:47:32Z nyef quit (Quit: G'night all) 2015-12-30T05:51:36Z ggole joined #lisp 2015-12-30T05:51:41Z mathi_aihtam joined #lisp 2015-12-30T05:53:53Z pjb: The first lisp implementation was indeed written in lisp, and hand-compiled into assembler. 2015-12-30T05:54:30Z pjb: If you have to write an assembler program, it's probably the best way to obtain a runnable result: write it in a high level programming language, and translate it to assembler by hand. 2015-12-30T05:54:34Z beach: kazlock: In the case of Common Lisp, there has been a gradual bootstrapping process, from early Lisp implementations, to MacLisp, to pre-standard Common Lisp, then to standard Common Lisp. For example, the SBCL compiler is largely still written in pre-standard Common Lisp. 2015-12-30T05:55:26Z kazlock: beach: that makes more sense than the grandfather paradox 2015-12-30T05:55:50Z pjb: kazlock: yes, there's no paradox, we just use a previous version of the language. 2015-12-30T05:56:21Z beach: kazlock: What pjb says. No paradox. Nowadays, of course, you can write a Common Lisp system using full Common Lisp. 2015-12-30T05:56:30Z beach: minion: Please tell kazlock about SICL. 2015-12-30T05:56:30Z minion: kazlock: SICL: SICL is a (perhaps futile) attempt to re-implement Common Lisp from scratch, hopefully using improved programming and bootstrapping techniques. See https://github.com/robert-strandh/SICL 2015-12-30T05:56:31Z mathi_aihtam quit (Client Quit) 2015-12-30T05:56:35Z vlatkoB joined #lisp 2015-12-30T05:56:52Z pjb: kazlock: notably, when you write a compiler, you don't necessarily use all the language features. For example, beach in writing SICL doesn't use defstruct or DO/DOTIMES/DOLIST. (He only uses CLOS and LOOP ;-)) So if you write an interpreter of a subset of CL that only contains CLOS and LOOP, you could probably compile SICL :-) 2015-12-30T05:57:20Z beach: Heh! 2015-12-30T05:57:27Z beach: Interesting subset there. 2015-12-30T05:58:04Z pjb: kazlock: notice: if = (loop repeat 1 if (= a b) do (something) else do (something-else)) 2015-12-30T05:58:25Z pjb: + return 2015-12-30T05:58:42Z kazlock: pjb: i don't follow 2015-12-30T05:58:48Z beach: pjb: You are going to confuse the hell out of kazlock. 2015-12-30T05:58:56Z pjb: kazlock: loop is turing complete. 2015-12-30T05:58:59Z beach: kazlock: pjb is messing with you. 2015-12-30T05:59:08Z kazlock: oh hahaha 2015-12-30T05:59:14Z kazlock: loop is a language in and of itself 2015-12-30T05:59:24Z kazlock: I've written more loop code than I have common lisp 2015-12-30T05:59:44Z beach: LOOP is definitely part of Common Lisp. 2015-12-30T06:00:09Z kazlock: but its it's own language, no? 2015-12-30T06:00:15Z jeti joined #lisp 2015-12-30T06:00:25Z kazlock: or is it part of the standard 2015-12-30T06:00:25Z pjb: It's a macro. 2015-12-30T06:00:27Z beach: Depends. It's all in the Common Lisp standard. 2015-12-30T06:00:33Z pjb: It's part of the standard. 2015-12-30T06:00:49Z beach: clhs loop 2015-12-30T06:00:49Z specbot: http://www.lispworks.com/reference/HyperSpec/Body/m_loop.htm 2015-12-30T06:01:01Z pjb: kazlock: have a look at: http://www.pipeline.com/~hbaker1/MetaCircular.html 2015-12-30T06:01:26Z kazlock: pjb: site's down 2015-12-30T06:01:57Z jeti` joined #lisp 2015-12-30T06:02:02Z lisse_ joined #lisp 2015-12-30T06:02:05Z pjb: Use http://www.archive.org then 2015-12-30T06:02:29Z pjb: https://web.archive.org/web/20150910212631/http://www.pipeline.com/~hbaker1/MetaCircular.html 2015-12-30T06:04:09Z beach: pjb: Such material might be beyond what kazlock is able to digest at this point in time. Hopefully, kazlock will stick around here so that this will eventually be possible, though. 2015-12-30T06:04:46Z kazlock: beach: I plan on it. So far lisp has been very satisfying to learn 2015-12-30T06:04:54Z White_Flame: regarding booting the very basic Lisp primitives there's a few ways you can do it. Similarly to logic gates, where you can build a NAND, then everything on top of that (including AND/OR/NOT); or build simpler AND/OR/NOT gates and build from those (including NAND) 2015-12-30T06:05:25Z goglosh joined #lisp 2015-12-30T06:05:37Z beach: White_Flame: But why would you want to do that? 2015-12-30T06:05:49Z White_Flame: depends on what's easiest with the substrate you've selected 2015-12-30T06:05:50Z kazlock: White_Flame: I just learned about that in my computer architecture class actually 2015-12-30T06:06:22Z White_Flame: if a nand is expensive in your substrate, it might be more effective to start with and+or 2015-12-30T06:06:23Z kazlock: NAND is the most basic logic gate that everything is build off of iirc 2015-12-30T06:06:48Z White_Flame: but it wasn't the first logic gate conceived 2015-12-30T06:06:51Z beach: White_Flame: I meant, why would you want to do it that way for Common Lisp? 2015-12-30T06:06:53Z jlarocco quit (Quit: Leaving) 2015-12-30T06:07:06Z Bicyclidine: {nand} is a set of logically complete gates. so is {and, or, not}. neither of them is the be-all end-all for actual computers 2015-12-30T06:07:07Z White_Flame: beach: do you start from cons cells, or from lambda? 2015-12-30T06:07:12Z kazlock: White_Flame: but I beleive its the first to be practically implemented 2015-12-30T06:07:18Z White_Flame: no 2015-12-30T06:07:36Z beach: White_Flame: Neither. I start from a full Common Lisp implementation. 2015-12-30T06:07:37Z White_Flame: once the full set of useful gates was accumulated, it was analyzed as to what could be built out of what 2015-12-30T06:07:40Z White_Flame: heh 2015-12-30T06:07:48Z Bicyclidine: Shannon's paper inventing digital logic was and, or, not, but had several others as well. 2015-12-30T06:07:58Z Bicyclidine: And I think knowing which are logically complete probably predates implementability. 2015-12-30T06:08:20Z White_Flame: the challenge of reducing everything to a grand unified gate has multiple answers. NAND just happens to be a good, accepted common one 2015-12-30T06:08:46Z White_Flame: but you could do the same with NOR 2015-12-30T06:08:56Z Bicyclidine: oh. yeah. wikipedia has a 1942 paper on completeness. 2015-12-30T06:08:57Z White_Flame: (iirc) 2015-12-30T06:09:38Z kazlock: White_Flame: NAND from NOR https://en.wikipedia.org/wiki/NAND_gate#/media/File:NAND_from_NOR.svg 2015-12-30T06:09:42Z Bicyclidine: well, shannon's 37, but still 2015-12-30T06:09:59Z White_Flame: but in general, the point is that you could define cons cells as data structures with accessors to the car & cdr, or you could lambdas and build cons cells from that 2015-12-30T06:10:03Z Bicyclidine: if you do computer stuff you should get used to there being multiple "minimal" whatevers for most things 2015-12-30T06:10:14Z Bicyclidine: and if you don't i'll make you rewrite emacs in snobol 2015-12-30T06:13:46Z slj joined #lisp 2015-12-30T06:14:40Z ggole_ joined #lisp 2015-12-30T06:15:21Z CEnnis91 quit (Quit: Connection closed for inactivity) 2015-12-30T06:15:34Z goglosh: lil questn 2015-12-30T06:15:53Z goglosh: is there a function that'll take a string "deadbeef" and read it as a hex number? 2015-12-30T06:16:04Z Bicyclidine: parse-integer 2015-12-30T06:16:14Z goglosh: thx 2015-12-30T06:16:55Z ggole quit (Ping timeout: 240 seconds) 2015-12-30T06:16:58Z yvm: Did somebody use cffi:translation-forms-for-class? Can't find an example and can't get why it initializes instance with (call-next-method), which return plist. 2015-12-30T06:17:25Z slj: clocc sourceforge net is down 2015-12-30T06:17:49Z slj: whats the best resource to get started using clocc 2015-12-30T06:17:58Z slj: ? 2015-12-30T06:20:44Z ggole__ joined #lisp 2015-12-30T06:21:28Z mordocai: slj: From the looks of it, you should wait for it to come back up. I'm not seeing links to anywhere else 2015-12-30T06:21:49Z slj: okay thanks 2015-12-30T06:22:42Z ggole_ quit (Ping timeout: 256 seconds) 2015-12-30T06:26:23Z ggole_ joined #lisp 2015-12-30T06:29:30Z ggole__ quit (Ping timeout: 256 seconds) 2015-12-30T06:30:21Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T06:30:37Z ggole__ joined #lisp 2015-12-30T06:31:11Z cmack joined #lisp 2015-12-30T06:31:26Z ggole_ quit (Ping timeout: 240 seconds) 2015-12-30T06:32:36Z ggole_ joined #lisp 2015-12-30T06:32:36Z ggole_ quit (Client Quit) 2015-12-30T06:33:32Z ggole joined #lisp 2015-12-30T06:33:41Z tmtwd joined #lisp 2015-12-30T06:34:16Z |3b| joined #lisp 2015-12-30T06:34:55Z ggole__ quit (Ping timeout: 240 seconds) 2015-12-30T06:35:46Z cmack quit (Ping timeout: 250 seconds) 2015-12-30T06:41:07Z goglosh quit (Remote host closed the connection) 2015-12-30T06:49:00Z adhoc quit (Ping timeout: 272 seconds) 2015-12-30T06:50:43Z adhoc joined #lisp 2015-12-30T06:54:06Z jsgrant joined #lisp 2015-12-30T06:58:00Z ramky joined #lisp 2015-12-30T06:59:50Z beach left #lisp 2015-12-30T07:00:28Z eazar001 joined #lisp 2015-12-30T07:07:19Z karbak joined #lisp 2015-12-30T07:08:27Z gravicappa joined #lisp 2015-12-30T07:13:43Z moore33 joined #lisp 2015-12-30T07:15:19Z CEnnis91 joined #lisp 2015-12-30T07:17:34Z |3b|` joined #lisp 2015-12-30T07:18:14Z |3b| quit (Ping timeout: 250 seconds) 2015-12-30T07:30:13Z Yuuhi joined #lisp 2015-12-30T07:41:37Z slj left #lisp 2015-12-30T07:48:22Z jsgrant quit (Remote host closed the connection) 2015-12-30T07:54:52Z karbak quit (Ping timeout: 272 seconds) 2015-12-30T07:58:59Z FreeBirdLjj quit (Read error: Connection reset by peer) 2015-12-30T07:59:15Z phoe_krk joined #lisp 2015-12-30T07:59:47Z trn quit (Quit: quit) 2015-12-30T07:59:58Z FreeBirdLjj joined #lisp 2015-12-30T08:03:24Z nightfly quit (Quit: WeeChat 1.0.1) 2015-12-30T08:04:36Z cadadar joined #lisp 2015-12-30T08:07:35Z constantinexvi quit (Ping timeout: 240 seconds) 2015-12-30T08:09:38Z constantinexvi joined #lisp 2015-12-30T08:13:26Z GGMethos quit (Ping timeout: 240 seconds) 2015-12-30T08:19:07Z eazar001 quit (Ping timeout: 260 seconds) 2015-12-30T08:21:37Z mishoo__ joined #lisp 2015-12-30T08:23:50Z blub` joined #lisp 2015-12-30T08:25:08Z eazar001 joined #lisp 2015-12-30T08:26:16Z blub quit (Ping timeout: 250 seconds) 2015-12-30T08:30:48Z mvilleneuve joined #lisp 2015-12-30T08:31:56Z cmack joined #lisp 2015-12-30T08:32:24Z ggole_ joined #lisp 2015-12-30T08:35:18Z ggole quit (Ping timeout: 256 seconds) 2015-12-30T08:36:15Z cmack quit (Ping timeout: 240 seconds) 2015-12-30T08:37:26Z constantinexvi quit (Ping timeout: 240 seconds) 2015-12-30T08:37:37Z constantinexvi joined #lisp 2015-12-30T08:38:13Z yvm: Is there a function analogous to remove-if, which passes indexes of sequence instead of values? 2015-12-30T08:39:01Z TMM joined #lisp 2015-12-30T08:39:06Z Petit_Dejeuner: yvm: What are you trying to do? 2015-12-30T08:39:20Z jackdaniel: yvm: you may provide closure as a test function with a counter 2015-12-30T08:39:23Z yvm: I want to remove #'evenp elements of list. 2015-12-30T08:39:47Z Petit_Dejeuner: Why do you want indexes? 2015-12-30T08:39:50Z jackdaniel: (remove-if (let ((cnt 0)) (lambda (val) (incf cnt) (if (= cnt 3) T))) 2015-12-30T08:40:00Z Bicyclidine: i'd just do (loop for i from 0 for elem in list when (evenp i) collect elem) 2015-12-30T08:40:36Z Petit_Dejeuner: Bicyclidine: s/when/unless ? 2015-12-30T08:41:03Z Bicyclidine: suuuuure yeah. 2015-12-30T08:41:14Z yvm: Indexes because I need to cut out even elements in plist. 2015-12-30T08:41:20Z `JRG joined #lisp 2015-12-30T08:41:21Z yvm: Thanks for suggestions. 2015-12-30T08:41:39Z `JRG: morning lispers 2015-12-30T08:41:46Z Petit_Dejeuner: morning 2015-12-30T08:41:50Z GGMethos joined #lisp 2015-12-30T08:44:00Z eazar001 quit (Quit: WeeChat 1.3) 2015-12-30T08:44:32Z mathi_aihtam joined #lisp 2015-12-30T08:45:06Z eazar001 joined #lisp 2015-12-30T08:45:30Z `JRG: little question for you: if PEEK-CHAR on stream signals an end-of-file condition, shouldn't READ-CHAR-NO-HANG do the same? 2015-12-30T08:45:41Z `JRG: with sbcl I can't get that to work 2015-12-30T08:45:51Z eazar001 quit (Client Quit) 2015-12-30T08:46:47Z `JRG: for instance, I cannot use READ-CHAR-NO-HANG to test whether a usocket socket stream has been remotely closed 2015-12-30T08:47:25Z eazar001 joined #lisp 2015-12-30T08:47:37Z `JRG: if I *first* call something like PEEK-CHAR, *then* later calls to READ-CHAR-NO-HANG result in the expected end-of-file error 2015-12-30T08:49:23Z `JRG: (what I'm really looking for is a non-blocking way to check that, actually...) 2015-12-30T08:49:43Z happy-dude quit (Quit: Connection closed for inactivity) 2015-12-30T08:55:44Z ggole__ joined #lisp 2015-12-30T08:58:10Z yvm: I doubt that there is a portable way to do non-blocking reading from file. If portability is not important for you, use C open function with O_NONBLOCK. There is one in sp-posix. 2015-12-30T08:58:36Z yvm: sb-posix 2015-12-30T08:58:59Z ggole_ quit (Ping timeout: 264 seconds) 2015-12-30T08:59:37Z ggole joined #lisp 2015-12-30T09:02:03Z ggole__ quit (Ping timeout: 260 seconds) 2015-12-30T09:02:59Z yvm: Oh, usocket stream you told. Never mind then. 2015-12-30T09:05:55Z tmtwd quit (Ping timeout: 260 seconds) 2015-12-30T09:06:44Z PuercoPop: TIL clsql comes with an loop implementation so they can add a clause to iterate through the results of a query 2015-12-30T09:08:43Z myrkraverk: Question: is a contribution to split-sequence welcome? 2015-12-30T09:09:12Z myrkraverk: I have a partial generalization for the delimiter to be a sequence and not an element. 2015-12-30T09:12:40Z PuercoPop: wouldn't the better way to find out be to send a PR or mail the author? 2015-12-30T09:13:25Z `JRG quit (Ping timeout: 252 seconds) 2015-12-30T09:13:54Z schaueho joined #lisp 2015-12-30T09:13:57Z myrkraverk: I don't know who to send mail to. 2015-12-30T09:14:22Z tobel joined #lisp 2015-12-30T09:14:55Z xorox90 joined #lisp 2015-12-30T09:15:42Z myrkraverk: There's this: https://github.com/sharplispers 2015-12-30T09:15:44Z PuercoPop: using quickdocs, the gh repo from where ql pulls is https://github.com/sharplispers/split-sequence/ 2015-12-30T09:16:02Z PuercoPop: and from the asd file the mantainers mail is 2015-12-30T09:16:26Z haasn quit (Ping timeout: 240 seconds) 2015-12-30T09:16:27Z myrkraverk: Hmm, I can try to email that. 2015-12-30T09:17:25Z easye quit (Remote host closed the connection) 2015-12-30T09:17:30Z easye` joined #lisp 2015-12-30T09:18:36Z bb010g quit (Quit: Connection closed for inactivity) 2015-12-30T09:18:41Z jeti` quit (Ping timeout: 246 seconds) 2015-12-30T09:18:41Z jeti quit (Ping timeout: 246 seconds) 2015-12-30T09:21:29Z myrkraverk: Btw, how do I test if something is a sequence or not? 2015-12-30T09:22:07Z myrkraverk: There's no SEQUENCE-P is there? 2015-12-30T09:23:59Z PuercoPop: myrkraverk: (defun sequencep (x) (typep x 'sequence)) seems to work 2015-12-30T09:24:28Z myrkraverk: Oh nice. 2015-12-30T09:25:23Z CEnnis91 quit (Quit: Connection closed for inactivity) 2015-12-30T09:25:44Z haasn joined #lisp 2015-12-30T09:27:27Z myrkraverk: Oh, great. Google tells me I may not have permission to mail to the group. 2015-12-30T09:27:37Z blt quit (Remote host closed the connection) 2015-12-30T09:28:08Z PuercoPop: myrkraverk: I imagine it would be better to open an issue in the repo 2015-12-30T09:28:30Z myrkraverk: Hmm, maybe. 2015-12-30T09:29:21Z myrkraverk: Last post seems to be from 2012 anyway. 2015-12-30T09:31:17Z freehck joined #lisp 2015-12-30T09:31:30Z myrkraverk: There we go: https://github.com/sharplispers/split-sequence/issues/5 2015-12-30T09:34:12Z defaultxr quit (Quit: gnight) 2015-12-30T09:35:28Z lnostdal joined #lisp 2015-12-30T09:37:31Z mishoo__ quit (Ping timeout: 260 seconds) 2015-12-30T09:38:38Z GGMethos quit (Ping timeout: 250 seconds) 2015-12-30T09:39:06Z karbak joined #lisp 2015-12-30T09:39:37Z phax joined #lisp 2015-12-30T09:40:56Z attila_lendvai joined #lisp 2015-12-30T09:40:56Z attila_lendvai quit (Changing host) 2015-12-30T09:40:56Z attila_lendvai joined #lisp 2015-12-30T09:42:43Z myrkraverk: Right now, I don't see a reason to implement more than I absolutely need, myself, unless someone else wants it. Hence the question. 2015-12-30T09:43:53Z karbak quit (Ping timeout: 246 seconds) 2015-12-30T09:46:16Z v117 joined #lisp 2015-12-30T09:49:54Z phax quit (Quit: phax) 2015-12-30T09:52:33Z kazlock quit (Remote host closed the connection) 2015-12-30T09:53:04Z v117 left #lisp 2015-12-30T09:53:19Z v117 joined #lisp 2015-12-30T09:56:38Z ramky quit (Remote host closed the connection) 2015-12-30T09:58:25Z prxq_ quit (Remote host closed the connection) 2015-12-30T09:58:49Z prxq joined #lisp 2015-12-30T10:01:03Z yuankode joined #lisp 2015-12-30T10:01:34Z trn joined #lisp 2015-12-30T10:01:55Z v117 quit (Quit: Leaving.) 2015-12-30T10:03:14Z phax joined #lisp 2015-12-30T10:05:26Z Mon_Ouie joined #lisp 2015-12-30T10:05:51Z malbertife joined #lisp 2015-12-30T10:06:59Z GGMethos joined #lisp 2015-12-30T10:07:05Z aap_ is now known as aap 2015-12-30T10:10:05Z sysfault quit (Ping timeout: 260 seconds) 2015-12-30T10:10:24Z mathi_aihtam quit (Ping timeout: 272 seconds) 2015-12-30T10:14:38Z FreeBirdLjj quit (Remote host closed the connection) 2015-12-30T10:17:30Z sz0 joined #lisp 2015-12-30T10:20:52Z quazimodo quit (Remote host closed the connection) 2015-12-30T10:25:38Z quazimodo joined #lisp 2015-12-30T10:25:40Z quazimod1 joined #lisp 2015-12-30T10:25:45Z quazimodo quit (Remote host closed the connection) 2015-12-30T10:25:45Z quazimod1 quit (Remote host closed the connection) 2015-12-30T10:25:59Z quazimodo joined #lisp 2015-12-30T10:32:01Z mathi_aihtam joined #lisp 2015-12-30T10:32:42Z cmack joined #lisp 2015-12-30T10:33:46Z mathi_aihtam quit (Client Quit) 2015-12-30T10:37:30Z cmack quit (Ping timeout: 260 seconds) 2015-12-30T10:42:27Z HoloIRCUser2 joined #lisp 2015-12-30T10:45:21Z mathi_aihtam joined #lisp 2015-12-30T10:48:22Z Nikotiini joined #lisp 2015-12-30T10:49:06Z earl-ducaine quit (Ping timeout: 240 seconds) 2015-12-30T10:49:46Z flip214: can I tell lparallel:make-kernel that the threads should run some initialization code? what's the method to have a :BEFORE? 2015-12-30T10:50:15Z xrash quit (Read error: Connection reset by peer) 2015-12-30T10:50:31Z earl-ducaine joined #lisp 2015-12-30T10:51:00Z kushal quit (Quit: Leaving) 2015-12-30T10:52:12Z flip214: I'd need to establish a database connection per-thread 2015-12-30T10:52:24Z loke: flip214: I'd use POOLER for that instead 2015-12-30T10:52:58Z loke: You pool the database connections so that you don't keep them per thread. 2015-12-30T10:53:45Z flip214: do you have an example for QUUX:hunchentoot and clsql? 2015-12-30T10:53:59Z flip214: lparallel:make-worker-thread isn't a generic. 2015-12-30T10:54:34Z loke: flip214: You can see what I'm doing with Rabbitmq connections here: 2015-12-30T10:54:50Z HoloIRCUser3 joined #lisp 2015-12-30T10:54:59Z HoloIRCUser2 quit (Ping timeout: 260 seconds) 2015-12-30T10:55:01Z loke: https://github.com/cicakhq/potato/blob/master/src/common/rabbitmq.lisp#L98 2015-12-30T10:55:34Z loke: flip214: There's a lot of extra safetly code there to deal with errors and stuff, but I'm sure you can wade through that to see the key call to POOLER:FETCH-FROM 2015-12-30T10:55:52Z loke: The pool is generated in the function above on line 90 2015-12-30T10:56:00Z flip214: yeah.... but how would I integrate that with quux-hunchentoot? 2015-12-30T10:56:46Z loke: flip214: You do exactly what you meant to do, just that when you need a database connection you fetch it from the pool instead of assuming it's already there "in the thread" 2015-12-30T10:56:50Z jrx joined #lisp 2015-12-30T10:56:51Z pbgc joined #lisp 2015-12-30T10:56:55Z loke: when you're done with it, just return it to the poo 2015-12-30T10:58:01Z flip214: loke: that means that *every* EASY-HANDLER function needs to do that. I'd prefer to just have a few threads up and running, each with each open connection. 2015-12-30T10:58:16Z flip214: yeah, they'd need to check whether the connection is broken and reconnect anyway, right. 2015-12-30T10:58:17Z loke: flip214: No. Why? 2015-12-30T10:58:47Z loke: You just create a nice macro WITH-DB-CONNECTION, and use that every time you access the database. 2015-12-30T10:58:47Z flip214: because I don't know which function gets called first within any given thread 2015-12-30T10:59:14Z flip214: yeah, of course I can move that code into a macro. still, I need to check every time I get called. 2015-12-30T10:59:15Z loke: flip214: it doesn't matter. The second call can very well use a different connection. 2015-12-30T10:59:42Z flip214: we're talking past each other, I believe. 2015-12-30T10:59:42Z kushal joined #lisp 2015-12-30T10:59:45Z loke: Why are you so hung up about every thread using the one and the same connection? 2015-12-30T10:59:53Z flip214: thanks all the same, following your pointers! 2015-12-30T11:00:05Z jrx left #lisp 2015-12-30T11:00:09Z whiteline quit (Ping timeout: 245 seconds) 2015-12-30T11:00:36Z flip214: because it looks easier than having a thread pool fetching connections from a connection pool - one-to-one, right? 2015-12-30T11:00:45Z loke: flip214: It's not 2015-12-30T11:01:12Z HoloIRCUser3 quit (Remote host closed the connection) 2015-12-30T11:01:14Z loke: Fetching from a pool is incredibly light-weight. The connections just sit there, waiting to be used. 2015-12-30T11:01:42Z loke: once you're done, it's returned, which is simply a connection object being added to a vector, ready to be used again. 2015-12-30T11:03:45Z flip214: for debugging it's harder. 2015-12-30T11:04:16Z loke: flip214: I don't see how. But whatever solution you choose is your choice. I have to leave th eoffice now. 2015-12-30T11:04:28Z flip214: thank you very much! 2015-12-30T11:05:32Z varjagg joined #lisp 2015-12-30T11:06:09Z FreeBirdLjj joined #lisp 2015-12-30T11:06:25Z FreeBirdLjj quit (Remote host closed the connection) 2015-12-30T11:06:43Z FreeBirdLjj joined #lisp 2015-12-30T11:12:50Z phoe_krk quit (Remote host closed the connection) 2015-12-30T11:14:14Z phoe_krk joined #lisp 2015-12-30T11:15:46Z phax quit (Quit: phax) 2015-12-30T11:19:11Z phax joined #lisp 2015-12-30T11:20:00Z phax quit (Client Quit) 2015-12-30T11:23:20Z eudoxia joined #lisp 2015-12-30T11:25:52Z zupoman joined #lisp 2015-12-30T11:27:01Z wmtb joined #lisp 2015-12-30T11:27:26Z attila_lendvai quit (Ping timeout: 240 seconds) 2015-12-30T11:28:30Z karbak joined #lisp 2015-12-30T11:28:58Z blub` is now known as blub 2015-12-30T11:32:15Z jtza8 joined #lisp 2015-12-30T11:33:05Z karbak quit (Ping timeout: 246 seconds) 2015-12-30T11:34:01Z mvilleneuve quit (Quit: This computer has gone to sleep) 2015-12-30T11:34:57Z Th30n joined #lisp 2015-12-30T11:38:37Z Karl_Dscc joined #lisp 2015-12-30T11:50:13Z puchacz joined #lisp 2015-12-30T11:52:37Z whiteline joined #lisp 2015-12-30T11:54:06Z tankfeeder joined #lisp 2015-12-30T11:54:08Z tankfeeder: hi all 2015-12-30T11:54:54Z tankfeeder: does anyone have pdf of Wilensky lisp book(s) ? 2015-12-30T11:55:22Z edgar-rft quit (Quit: edgar-rft) 2015-12-30T11:57:52Z NeverDie quit (Quit: http://radiux.io/) 2015-12-30T12:00:47Z jackdaniel: is it available for free? 2015-12-30T12:00:56Z xrash joined #lisp 2015-12-30T12:02:19Z z0d: it's like 8 bucks? 2015-12-30T12:03:50Z jackdaniel: even if it would be 800, then if author haven't published it for free download, nobody should give share such pdf 2015-12-30T12:04:30Z tankfeeder: really? ok 2015-12-30T12:07:26Z z0d: it's illegal 2015-12-30T12:07:46Z mishoo__ joined #lisp 2015-12-30T12:08:18Z tankfeeder: good. 2015-12-30T12:08:19Z tankfeeder left #lisp 2015-12-30T12:09:04Z myrkraverk: What are the Wilensky lisp books? 2015-12-30T12:10:57Z myrkraverk: Oh, hmm. Is it for sale through anything other than amazon? 2015-12-30T12:15:51Z mvilleneuve joined #lisp 2015-12-30T12:20:21Z FreeBirdLjj quit (Remote host closed the connection) 2015-12-30T12:21:48Z wmtb quit (Quit: ERC (IRC client for Emacs 24.5.1)) 2015-12-30T12:22:22Z Karl_Dscc quit (Remote host closed the connection) 2015-12-30T12:28:20Z mbuf quit (Remote host closed the connection) 2015-12-30T12:31:44Z wmtb joined #lisp 2015-12-30T12:32:25Z jackdaniel: on alibris for instance 2015-12-30T12:33:00Z Beetny quit (Ping timeout: 260 seconds) 2015-12-30T12:33:32Z cmack joined #lisp 2015-12-30T12:34:23Z anti-freeze joined #lisp 2015-12-30T12:34:51Z myrkraverk: ok. 2015-12-30T12:38:15Z cmack quit (Ping timeout: 260 seconds) 2015-12-30T12:39:36Z earl-ducaine quit (Ping timeout: 265 seconds) 2015-12-30T12:40:40Z jtza8 quit (Ping timeout: 256 seconds) 2015-12-30T12:42:26Z wmtb quit (Quit: ERC (IRC client for Emacs 24.5.1)) 2015-12-30T12:44:02Z sweater joined #lisp 2015-12-30T12:44:27Z sweater is now known as Guest81530 2015-12-30T12:50:34Z tbx joined #lisp 2015-12-30T12:52:14Z EvW joined #lisp 2015-12-30T12:55:52Z mathi_aihtam quit (Quit: mathi_aihtam) 2015-12-30T12:56:45Z badkins joined #lisp 2015-12-30T12:57:46Z mathi_aihtam joined #lisp 2015-12-30T13:00:00Z yvm: Am I understand it correct that defining methods for cffi:translate-from-foreign specializing on :class foo won't make CFFI convert correspond C structure objects by itself and I need to call convert-from-foreign explicitly? 2015-12-30T13:00:23Z mathi_aihtam quit (Client Quit) 2015-12-30T13:00:38Z eudoxia quit (Quit: Leaving) 2015-12-30T13:05:36Z agumonkey quit (Ping timeout: 264 seconds) 2015-12-30T13:05:40Z agumonkey_ joined #lisp 2015-12-30T13:06:04Z agumonkey_ is now known as agumonkey 2015-12-30T13:09:12Z Guest20174 quit (Ping timeout: 264 seconds) 2015-12-30T13:12:50Z TMM quit (Quit: Ex-Chat) 2015-12-30T13:15:36Z luis: yvm: what does it mean to specialise on ":class foo"? 2015-12-30T13:16:31Z Guest20174 joined #lisp 2015-12-30T13:17:25Z karbak joined #lisp 2015-12-30T13:17:36Z luis: yvm: anyway, you shouldn't have to call convert-from-foreign explicitly in most cases, no. 2015-12-30T13:19:26Z TDT joined #lisp 2015-12-30T13:21:05Z pbgc quit (Quit: Computer has gone to sleep.) 2015-12-30T13:22:18Z karbak quit (Ping timeout: 272 seconds) 2015-12-30T13:24:06Z newcup quit (Ping timeout: 240 seconds) 2015-12-30T13:29:03Z yvm: Ok then. Thanks. 2015-12-30T13:30:27Z luis: yvm: there may be an example in the test suite, I'm not sure. 2015-12-30T13:31:31Z zotherstupidguy quit (Quit: WeeChat 1.3) 2015-12-30T13:32:04Z jtza8 joined #lisp 2015-12-30T13:35:04Z mathi_aihtam joined #lisp 2015-12-30T13:35:43Z hiroakip joined #lisp 2015-12-30T13:36:42Z newcup joined #lisp 2015-12-30T13:37:24Z eli joined #lisp 2015-12-30T13:38:09Z pwnie joined #lisp 2015-12-30T13:40:45Z Karl_Dscc joined #lisp 2015-12-30T13:42:22Z EvW quit (Quit: EvW) 2015-12-30T13:42:37Z EvW joined #lisp 2015-12-30T13:42:38Z HoloIRCUser3 joined #lisp 2015-12-30T13:43:47Z clique joined #lisp 2015-12-30T13:44:12Z HoloIRCUser3 quit (Remote host closed the connection) 2015-12-30T13:45:44Z l04m33 quit (Ping timeout: 246 seconds) 2015-12-30T13:47:04Z clique quit (Quit: Page closed) 2015-12-30T13:47:05Z sysfault joined #lisp 2015-12-30T13:51:06Z grouzen quit (Ping timeout: 240 seconds) 2015-12-30T13:52:07Z Mon_Ouie quit (Quit: WeeChat 1.3) 2015-12-30T13:54:10Z scymtym joined #lisp 2015-12-30T13:58:06Z l04m33 joined #lisp 2015-12-30T14:00:21Z tbx quit (Quit: ERC (IRC client for Emacs 24.5.1)) 2015-12-30T14:01:45Z yenda joined #lisp 2015-12-30T14:08:32Z eli quit (Remote host closed the connection) 2015-12-30T14:09:27Z eli joined #lisp 2015-12-30T14:12:36Z pbgc joined #lisp 2015-12-30T14:13:30Z zygentoma joined #lisp 2015-12-30T14:15:18Z jtza8 quit (Ping timeout: 265 seconds) 2015-12-30T14:17:55Z happy-dude joined #lisp 2015-12-30T14:22:53Z warweasle joined #lisp 2015-12-30T14:34:31Z cmack joined #lisp 2015-12-30T14:34:48Z anti-freeze quit (Remote host closed the connection) 2015-12-30T14:35:33Z nell joined #lisp 2015-12-30T14:39:22Z psy joined #lisp 2015-12-30T14:44:00Z xrash quit (Remote host closed the connection) 2015-12-30T14:45:15Z LiamH joined #lisp 2015-12-30T14:45:59Z smokeink quit (Ping timeout: 260 seconds) 2015-12-30T14:46:46Z Denommus joined #lisp 2015-12-30T14:47:57Z smokeink joined #lisp 2015-12-30T14:58:57Z phax joined #lisp 2015-12-30T15:00:08Z voidengineer-w joined #lisp 2015-12-30T15:06:22Z karbak joined #lisp 2015-12-30T15:06:56Z Xach joined #lisp 2015-12-30T15:11:00Z karbak quit (Ping timeout: 250 seconds) 2015-12-30T15:11:11Z zymurgy quit (Ping timeout: 260 seconds) 2015-12-30T15:15:14Z zymurgy joined #lisp 2015-12-30T15:16:46Z lisse_ joined #lisp 2015-12-30T15:17:41Z oskarth quit (Quit: Updating details, brb) 2015-12-30T15:18:17Z oskarth joined #lisp 2015-12-30T15:31:05Z phax quit (Ping timeout: 246 seconds) 2015-12-30T15:34:25Z pbgc quit (Quit: Computer has gone to sleep.) 2015-12-30T15:34:26Z GGMethos quit (Ping timeout: 240 seconds) 2015-12-30T15:34:48Z EvW quit (Ping timeout: 255 seconds) 2015-12-30T15:38:38Z jusss joined #lisp 2015-12-30T15:39:14Z jusss: hi there, how to make a symbol type like '+ turn to a procedure + ? 2015-12-30T15:39:27Z jusss: or mean it 2015-12-30T15:39:47Z oGMo: so much misconception 2015-12-30T15:40:01Z jusss: a list, like ('+ '1 '1) , now how to turn it to (+ 1 1) ? 2015-12-30T15:40:23Z oGMo: what are you actually trying to accomplish? 2015-12-30T15:40:42Z oGMo: '(+ 1 1) => (+ 1 1) 2015-12-30T15:40:52Z attila_lendvai joined #lisp 2015-12-30T15:40:52Z attila_lendvai quit (Changing host) 2015-12-30T15:40:52Z attila_lendvai joined #lisp 2015-12-30T15:41:09Z oGMo: (list '+ 1 1) => (+ 1 1) 2015-12-30T15:41:29Z jusss: oGMo: I'm trying to write a simple parser and eval 2015-12-30T15:41:35Z oGMo: however, if you're trying to add two numbers, or call a function named +, that's an _entirely_ different question 2015-12-30T15:41:36Z antoszka: any CL hackers on 32c3? Is there an assembly or something? 2015-12-30T15:43:02Z jusss: oGMo: now I can turn a string "(+ 1 1)" to ('+ '1 '1), but I don't know how to do turn it to (+ 1 1) 2015-12-30T15:43:11Z oGMo: jusss: if you're just exploring how to write a reader, ok .. if you're writing this for some other purpose, note CL _already_ has a reader you can take advantage of, and it's almost never a good idea to eval 2015-12-30T15:43:12Z Zhivago: jusss: Perhaps you are looking for (symbol-function '+)? 2015-12-30T15:43:37Z oGMo: "(+ 1 1)" should not turn into ('+ '1 '1) 2015-12-30T15:44:04Z Zhivago: Presumably he means (list '+ '1 '1) 2015-12-30T15:44:14Z zymurgy quit (Ping timeout: 265 seconds) 2015-12-30T15:44:17Z oGMo: with the questions being asked i'm _definitely_ not assuming that 2015-12-30T15:44:26Z jusss: oGMo: actually I'd like to eval a string like "(+ 1 1)" 2015-12-30T15:44:45Z jusss: like eval() in python 2015-12-30T15:45:01Z oGMo: jusss: (eval (read-from-string "(+ 1 1)")) 2015-12-30T15:45:23Z oGMo: however, there's rarely a good reason to do that; if you're doing something "like python" then you're doing it wrong 2015-12-30T15:46:35Z oGMo: if you're writing a repl or something that takes user input and evaluates it, that's probably the only good exception 2015-12-30T15:47:14Z jusss: oGMo: I don't mean that, I'd like to write robot on #some-channels, and the robot can read strings and eval it like some websites do that 2015-12-30T15:48:13Z oGMo: jusss: then you probably want the above, but obviously beware untrusted input 2015-12-30T15:49:14Z zymurgy joined #lisp 2015-12-30T15:49:15Z constantinexvi quit (Ping timeout: 240 seconds) 2015-12-30T15:50:18Z jusss: Zhivago: hi, I can't find messages about symbol-function on website, can you give some links ? thanks 2015-12-30T15:50:30Z Xach: http://l1sp.org/cl/symbol-function is the website 2015-12-30T15:50:38Z yenda quit (Remote host closed the connection) 2015-12-30T15:50:45Z constantinexvi joined #lisp 2015-12-30T15:52:10Z jusss: Xach: I see 2015-12-30T15:53:05Z pbgc joined #lisp 2015-12-30T15:53:52Z anti-freeze joined #lisp 2015-12-30T15:54:52Z s00pcan quit (Ping timeout: 265 seconds) 2015-12-30T15:56:31Z ebrasca joined #lisp 2015-12-30T15:56:38Z s00pcan joined #lisp 2015-12-30T15:57:20Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T15:57:38Z smokeink quit (Remote host closed the connection) 2015-12-30T16:02:33Z Jonsky joined #lisp 2015-12-30T16:02:45Z munksgaard joined #lisp 2015-12-30T16:02:55Z GGMethos joined #lisp 2015-12-30T16:04:35Z munksgaard: I'm trying to use Drakma to get some json, and I for convenience sake I just want to interpret http responses with content type "application/json" as plain text. I see that I can add `("application" . "json") to drakma:*text-content-types*, but it seems like modifying a drakma internal variable is... imprudent. Is there any other way to do it, or is this the intended use of *text-content-types* ? 2015-12-30T16:05:10Z Zhivago: Well, it is exported for public use ... 2015-12-30T16:05:16Z Zhivago: I'd check the documentation. 2015-12-30T16:06:01Z rpg joined #lisp 2015-12-30T16:06:12Z yenda joined #lisp 2015-12-30T16:06:58Z Jonsky quit (Client Quit) 2015-12-30T16:07:15Z karbak joined #lisp 2015-12-30T16:07:26Z myrkraverk: Well, I have a code here that uses :want-stream t to read octets, which then get interpreted by sb-ext:octets-to-string. 2015-12-30T16:07:30Z rpg: Today's weird question: anyone have/know a library that supports transactional assignments? I.e., have a macro that assigns a new value to a place in a way that provides an UNDO? 2015-12-30T16:07:34Z munksgaard: Zhivago: The documentation mentions that *text-content-types* specifies which content types to interpret as text, but it's not really clear on whether or not I'm expected to modify it (http://weitz.de/drakma/#*text-content-types*) 2015-12-30T16:07:40Z myrkraverk: munksgaard: will that make you happier? 2015-12-30T16:08:05Z Jonsky joined #lisp 2015-12-30T16:08:34Z munksgaard: myrkraverk: I see! That might indeed make me happier :) 2015-12-30T16:09:33Z dwchandler: munksgaard: out of curiousity... what issue are you having that makes you want to do this? 2015-12-30T16:10:09Z myrkraverk: I jumped through those hoops in order to decode shift-jis. flexi-streams don't do that (yet) which is what I believe drakma uses to convert stuff behind the scenes. 2015-12-30T16:12:53Z munksgaard: dwchandler: I have a request that can either fail or succeed: If it fails I get a 404 and the returned content has type "text/plain", even though it actually contains json, and if it succeeds I get a 200 and the returned content has type "application/json". Drakma returns the 404 message as a string, and the 200 message as a vector. I just wanted to treat both of them as strings (or vectors, either is fin 2015-12-30T16:13:00Z munksgaard: e). 2015-12-30T16:15:08Z munksgaard: I guess it just annoyed me that I got two different return types. 2015-12-30T16:15:09Z dwchandler: Ah, yeah. 2015-12-30T16:16:30Z yenda quit (Remote host closed the connection) 2015-12-30T16:16:37Z myrkraverk: I see. 2015-12-30T16:18:10Z munksgaard: Ah, there we are. :force-binary is what I need :) 2015-12-30T16:18:29Z munksgaard: Or rather, it does what I need for now :) 2015-12-30T16:18:37Z munksgaard: Thanks, guys! 2015-12-30T16:18:45Z myrkraverk: munksgaard: oh nice. That's even easier than jumping through the hoops I did. 2015-12-30T16:19:15Z dwchandler: Too bad there's not :stop-putting-text-in-vectors 2015-12-30T16:19:49Z myrkraverk: dwchandler: yeah, I guess that's needed too, sometimes. 2015-12-30T16:20:24Z dwchandler: It's an interesting assumption about consumers of json 2015-12-30T16:20:45Z myrkraverk notes down :force-binary 2015-12-30T16:20:57Z dwchandler: And probably a self-fulfilling prophesy to a large degree 2015-12-30T16:21:03Z anti-freeze quit (Remote host closed the connection) 2015-12-30T16:21:05Z myrkraverk: *nod* 2015-12-30T16:21:54Z pjb: jusss: you need to use mapcar to remove the quotes: (mapcar (lambda (quoted-form) (second quoted-form)) '('+ '1 '1)) #| --> (+ 1 1) |# 2015-12-30T16:25:27Z myrkraverk: Maybe I should write a blog about how easy it is to dump json into postgres with lisp, using drakma and postmodern. 2015-12-30T16:27:27Z pjb: Isn't it even more easy to dum sexps? 2015-12-30T16:27:32Z pjb: dump 2015-12-30T16:28:46Z myrkraverk: pjb: not when the data you want is provided as json. 2015-12-30T16:28:57Z kazlock joined #lisp 2015-12-30T16:29:45Z karbak quit (Ping timeout: 245 seconds) 2015-12-30T16:30:02Z pjb: Somebody should write reader macros to read json directly as sexps… 2015-12-30T16:32:07Z myrkraverk: pjb: how exactly would that help, when you want a subset of the json object(s)? 2015-12-30T16:32:20Z kazlock: pjb: http://danthedev.com/2015/09/09/lisp-in-your-language/ 2015-12-30T16:32:56Z _sjs quit (Ping timeout: 272 seconds) 2015-12-30T16:37:03Z harish_ quit (Ping timeout: 260 seconds) 2015-12-30T16:40:01Z pwnie quit (Quit: = "") 2015-12-30T16:42:13Z cadadar quit (Quit: Leaving.) 2015-12-30T16:48:20Z cadadar joined #lisp 2015-12-30T16:49:35Z harish_ joined #lisp 2015-12-30T16:50:23Z mvilleneuve quit (Quit: This computer has gone to sleep) 2015-12-30T16:51:15Z pbgc quit (Quit: Textual IRC Client: http://www.textualapp.com/) 2015-12-30T16:55:11Z kazlock: When (let ((x 5))) is executed, where does the 'x' symbol live, where does 5 live, and how are 'x' and 5 connected? 2015-12-30T16:56:16Z pjb: Since x is not used, it is compiled to NOP. 2015-12-30T16:56:35Z pjb: Try: (disassemble (compile nil (lambda () (let ((x 5)))))) 2015-12-30T16:56:41Z kazlock: ok. (let ((x 5)) ...) 2015-12-30T16:57:01Z kazlock: repeat my question for while ... is executing 2015-12-30T16:57:11Z pjb: If there's no mutation to x, then x can be compiled as a name for 5, without allocating memory for it. 2015-12-30T16:57:32Z pjb: no mutation and no closure. 2015-12-30T16:58:26Z mordocai: kazlock: I guess the short answer is, compilers are smart and what stuff actually happens is complicated. disassemble is your friend if you can read assembly 2015-12-30T16:59:03Z kazlock: mordocai: I'm just haven't trouble understanding how symbols relate to values in lisp conceptually 2015-12-30T16:59:12Z pjb: They don't. 2015-12-30T16:59:37Z kazlock: then why is it that if I do (format t "%d" x) 5 prints? 2015-12-30T16:59:39Z pjb: Symbols NAME lexical variables. Lexical variables are BOUND to values. 2015-12-30T16:59:47Z pjb: Compilation will keep the variable, and throw away the symbol. 2015-12-30T17:00:21Z pjb: (unless you use high debug level, so that the compiler will helpfully keep mappings of variable names to let you debug them more easily. 2015-12-30T17:02:33Z kazlock: the thing that sparked this question is that I'm trying to understand the difference between (set x 5) and (set 'x 5) 2015-12-30T17:03:28Z pjb: kazlock: now, set modifies the global dynamic binding of the variable named by the symbol passed in the first argument. SET is a FUNCTION. 2015-12-30T17:03:41Z pjb: what value is bound to the variable named X? 2015-12-30T17:03:54Z kazlock: in this case, nothing yet 2015-12-30T17:04:09Z pjb: Then the first expression will be an error. 2015-12-30T17:04:28Z pjb: (let ((x 'y)) (set x 5) (assert (= 5 (symbol-value 'y)))) 2015-12-30T17:04:49Z pjb: (progn (set 'x 5) (assert (= 5 (symbol-value 'x)))) 2015-12-30T17:05:11Z bugrum joined #lisp 2015-12-30T17:05:16Z _sjs joined #lisp 2015-12-30T17:05:43Z kazlock: so x and 'x are being evaluated before set because they are arguments to set 2015-12-30T17:05:44Z pjb: SET is a legacy function, that you wouldn't normally use. If you wanted to set the symbol-value of a symbol, you would use instead: (setf (symbol-value 'x) 5) 2015-12-30T17:06:01Z anti-freeze joined #lisp 2015-12-30T17:06:12Z pjb: because SET is a function. 2015-12-30T17:06:50Z pjb: SETQ is a special operator and SETF is a macro, so the rules are different for them. 2015-12-30T17:07:28Z kazlock: (setq x 5) === (set 'x 5) right? 2015-12-30T17:07:40Z pjb: Yes. 2015-12-30T17:07:45Z pjb: BUT 2015-12-30T17:07:51Z tmtwd joined #lisp 2015-12-30T17:08:02Z Jonsky quit (Ping timeout: 246 seconds) 2015-12-30T17:08:09Z pjb: setq actually may work with lexical bindings, and by default bindings are lexical. 2015-12-30T17:08:30Z pjb: Furthermore, setq will defer to setf when x is a symbol-macro. In which case the meaning can be entirely different. 2015-12-30T17:08:51Z pjb: (let ((x 0)) (setq x 5) (set 'x 3) (list x (symbol-value 'x))) #| --> (5 3) |# 2015-12-30T17:09:04Z anti-freeze quit (Remote host closed the connection) 2015-12-30T17:09:29Z pjb: (symbol-macrolet ((x y)) (let ((y 0)) (setq x 4) (list x y))) #| --> (4 4) |# 2015-12-30T17:10:09Z pjb: (symbol-macrolet ((x y)) (let ((y 0)) (setq x 4) (set 'x 3) (list x y (symbol-value 'x)))) #| --> (4 4 3) |# 2015-12-30T17:10:41Z voidengineer-w: lol 2015-12-30T17:11:14Z pjb: also, symbol-macros are lexical bindings, so they can be shadowed, and they can shadow other variable lexical bindings: (symbol-macrolet ((x y)) (let ((x 0) (y 0)) (setq x 4) (list x y))) #| --> (4 0) |# 2015-12-30T17:11:45Z kazlock: i feel overwhelmed :O 2015-12-30T17:11:56Z anti-freeze joined #lisp 2015-12-30T17:12:00Z voidengineer-w: good, you're still human and not a machine 2015-12-30T17:12:15Z kazlock: phew 2015-12-30T17:12:36Z dwchandler: kazlock: any one thing makes sense, but it's hard to keep everything straight at first. it gets better :) 2015-12-30T17:13:14Z kazlock: dwchandler: I think i should review lexical vs dynamics scope 2015-12-30T17:13:41Z bb010g joined #lisp 2015-12-30T17:15:39Z voidengineer-w: and do read the hyperspec page on symbol-macrolet and related pages. You could also practice this a bit to get the hang of it 2015-12-30T17:17:25Z EvW joined #lisp 2015-12-30T17:18:09Z Denommus` joined #lisp 2015-12-30T17:18:41Z lisse_ joined #lisp 2015-12-30T17:19:42Z nell quit (Ping timeout: 250 seconds) 2015-12-30T17:19:56Z badkins quit (Ping timeout: 246 seconds) 2015-12-30T17:20:05Z Denommus quit (Ping timeout: 276 seconds) 2015-12-30T17:20:25Z BitPuffin|osx joined #lisp 2015-12-30T17:20:27Z pjb: Or you may ignore it momentarily and just remember that (set 'x 4) is not at all the same thing as (setq x 4) even if setq comes historically from (set '…) 2015-12-30T17:21:07Z eudoxia joined #lisp 2015-12-30T17:21:42Z eudoxia quit (Client Quit) 2015-12-30T17:24:32Z jasom: kazlock: or you could ignore all assignment operators other than setf; that's the easiest when writing code, though you'll have to learn others to read code 2015-12-30T17:30:50Z phoe_krk quit (Quit: http://phoe-krk.tumblr.com/) 2015-12-30T17:31:11Z jusss quit (Quit: ERC (IRC client for Emacs 24.5.1)) 2015-12-30T17:31:12Z phoe_krk joined #lisp 2015-12-30T17:33:41Z drichards joined #lisp 2015-12-30T17:35:53Z Th30n quit (Quit: leaving) 2015-12-30T17:40:57Z holycow joined #lisp 2015-12-30T17:41:43Z kazlock: how long does it take you to comprehend this? (from practical common lisp) http://paste.lisp.org/display/304203 2015-12-30T17:42:18Z anti-freeze quit (Read error: Connection reset by peer) 2015-12-30T17:43:42Z synchromesh: kazlock: MACROEXPAND-1 is your friend... :) 2015-12-30T17:46:45Z mordocai: kazlock: the answer for me is "awhile" 2015-12-30T17:46:50Z mordocai: I'm pretty new to lisp too though 2015-12-30T17:47:23Z kazlock: I'm still trying to figure out how to use it 2015-12-30T17:48:46Z futpib_ joined #lisp 2015-12-30T17:48:51Z pjb: kazlock: 30 seconds. 2015-12-30T17:49:02Z kazlock: impressive 2015-12-30T17:49:22Z pjb: kazlock: that is, 2 second to understand what it is, and 30 second to read and see how it does it and check it does it correctly. 2015-12-30T17:49:24Z kazlock: to the point that you could reimplement it without checking? 2015-12-30T17:49:39Z pjb: Sure. I must have my own around. 2015-12-30T17:49:44Z zupoman quit (Ping timeout: 245 seconds) 2015-12-30T17:50:57Z manuel_ joined #lisp 2015-12-30T17:53:04Z pjb: kazlock: prior knowledge is that in CL, when you write macros, sometimes you have expressions given in parameters to the macro that must be evaluated once (that should be the default in general for the expressions you give to your macros). So to do so, you need to generate a let form that binds them to variables. You can use as variable names the name of the macro parameters. But if you use the name of the macro parameters to create 2015-12-30T17:53:04Z pjb: those variables, those names could be used in the environment where the macro is called, so this let form would shadow them. To avoid shadowing them while evaluating the expression, we use temporary variable names created with gensyms. 2015-12-30T17:54:10Z pjb: (that said, since we use let and not let*, this shadowing should not be a problem while evaluating the expressions…) 2015-12-30T17:55:20Z kazlock: which is why (do ((x 0 (1+ x)) ((< x (random 10)) (format t "~d~%" x)) works right? 2015-12-30T17:55:30Z ajf- joined #lisp 2015-12-30T17:56:52Z Denommus` is now known as Denommus 2015-12-30T17:57:54Z pjb: Actually, you don't even need to use macroexpand to understand it, in this case, just applying it is enough: (let ((a '(aref v (incf i))) (b '(aref v (decf i)))) (once-only (a b) `(+ ,a ,b))) --> (let ((#1=#:g7019 (aref v (incf i))) (#2=#:g7020 (aref v (decf i)))) (+ #1# #2#)) 2015-12-30T17:59:00Z pjb: so the inner let is to remap the macro parameters (the variables a and b in the example) to the gensym that will be bound to the evaluated expressions, so that you may use them in the expansion of your macro. 2015-12-30T17:59:17Z bugrum quit 2015-12-30T17:59:41Z pjb: A better example of the effectiveness would be: (let ((a '(aref v (incf i))) (b '(aref v (decf i)))) (once-only (a b) `(+ ,a ,a ,b ,b))) --> (let ((#1=#:g7026 (aref v (incf i))) (#2=#:g7027 (aref v (decf i)))) (+ #1# #1# #2# #2#)) 2015-12-30T18:00:20Z gravicappa quit (Ping timeout: 272 seconds) 2015-12-30T18:00:32Z pjb: If we didn't use once-only: (let ((a '(aref v (incf i))) (b '(aref v (decf i)))) `(+ ,a ,a ,b ,b)) --> (+ #1=(aref v (incf i)) #1# #2=(aref v (decf i)) #2#) ; here you can see that incf and decf are called twice, so we don't get the expected result. 2015-12-30T18:01:03Z kazlock: ah 2015-12-30T18:01:48Z Ven joined #lisp 2015-12-30T18:02:57Z nightfly joined #lisp 2015-12-30T18:03:45Z pjb: kazlock: remember, when you get expressions in macros for run-time, unless you're writing a looping macro or something, users of the macro will expect those expression to be evaluated only once (and from left to right too), which matters when there are side effects such as incf/decf, print, etc. 2015-12-30T18:04:05Z pwnie joined #lisp 2015-12-30T18:04:38Z kazlock: otherwise you would have "implementation leak" in your macro right? 2015-12-30T18:05:19Z CEnnis91 joined #lisp 2015-12-30T18:05:53Z pjb: Call it as you want, it's a bug. Again, unless your macros is supposed to do it. 2015-12-30T18:06:11Z kazlock: thats what practical common lisp was calling it 2015-12-30T18:06:28Z mlr|dreaming is now known as mlrutherford 2015-12-30T18:06:40Z pjb: For example if (do-two-times (print 'x)) should print x twice, then of course, you won't use once-only. 2015-12-30T18:07:14Z pjb: But if (list-twice (print 'x)) must return (x x), perhaps you want it to print only once. 2015-12-30T18:07:25Z kazlock: I see 2015-12-30T18:08:04Z pjb: Consider: (let ((v (vector 1 2 3 4)) (i 0)) (list-twice (aref v (incf i)))) If you want to return (2 2), then you cannot evaluate (aref v (incf i)) twice. You must use once-only (or something similar). 2015-12-30T18:08:41Z pjb: But for: (let ((v (vector 1 2 3 4)) (i 0)) (collect-two-times (aref v (incf i)))) you may want to return (2 3), and here not use once-only. 2015-12-30T18:10:13Z kazlock: its just a matter of whether you want the expressions to be executed more than once or not (and they are by default) 2015-12-30T18:10:23Z pjb: Another example would be: (push2 1 2 list)) You may want list to become (1 2 …) ie. (push2 1 2 list) == (progn (push 2 list) (push 1 list)). BUT in (push2 1 2 list), 1 is before (on the left of) 2. So 1 should be evaluated before 2. But in the expansion: (progn (push 2 list) (push 1 list)) the order is reversed. 2015-12-30T18:11:40Z pjb: You want: (let ((i 0) (list '())) (push2 (incf i) (incf i) list) list) --> (1 2) For this, you need to evaluate the two arguments left to right before using the result in (progn (push first-arg list) (push second arg list)). 2015-12-30T18:12:01Z pjb: Actually, in this expansion list is used twice, which is wrong ;-) 2015-12-30T18:12:47Z pjb: For a push2 macro, you would need to consider list as a place, and use a defsetf expander, or even get-setf-expansion to process it properly. 2015-12-30T18:13:25Z pjb: Just to say that to write a push2 macros correctly in CL, it's not so simple, and you have to use some quite sophisticated operators. 2015-12-30T18:14:32Z karbak joined #lisp 2015-12-30T18:14:44Z zupoman joined #lisp 2015-12-30T18:14:44Z lnostdal quit (Ping timeout: 245 seconds) 2015-12-30T18:16:24Z pjb: Yes, for push2, you'd have to use get-setf-expansion, since defsetf is to define (setf …) places. 2015-12-30T18:18:09Z anti-freeze joined #lisp 2015-12-30T18:19:59Z karbak quit (Ping timeout: 264 seconds) 2015-12-30T18:20:08Z anti-freeze quit (Remote host closed the connection) 2015-12-30T18:21:35Z anti-freeze joined #lisp 2015-12-30T18:24:09Z pjb: kazlock: push2 http://paste.lisp.org/display/304207 2015-12-30T18:25:16Z Jonsky joined #lisp 2015-12-30T18:27:35Z EvW quit (Ping timeout: 255 seconds) 2015-12-30T18:30:01Z badkins joined #lisp 2015-12-30T18:33:12Z earl-ducaine joined #lisp 2015-12-30T18:35:28Z elimik31 joined #lisp 2015-12-30T18:36:11Z eli quit (Ping timeout: 264 seconds) 2015-12-30T18:37:15Z lnostdal joined #lisp 2015-12-30T18:38:49Z shka joined #lisp 2015-12-30T18:41:31Z karbak joined #lisp 2015-12-30T18:49:44Z earl-ducaine quit (Ping timeout: 272 seconds) 2015-12-30T18:51:06Z jtza8 joined #lisp 2015-12-30T18:52:52Z sysfault quit (Ping timeout: 250 seconds) 2015-12-30T18:55:11Z EvW joined #lisp 2015-12-30T18:57:22Z fsmunoz joined #lisp 2015-12-30T18:57:25Z fsmunoz: hello 2015-12-30T18:57:34Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T18:59:04Z pjb: hi 2015-12-30T19:00:06Z pwnie quit (Read error: Connection reset by peer) 2015-12-30T19:01:03Z voidengineer-w quit (Quit: Leaving) 2015-12-30T19:02:07Z blub: hi fsmunoz 2015-12-30T19:03:41Z lisse_ joined #lisp 2015-12-30T19:03:49Z moore_ joined #lisp 2015-12-30T19:05:34Z moore33 quit (Ping timeout: 245 seconds) 2015-12-30T19:05:50Z AlphaAtom joined #lisp 2015-12-30T19:05:55Z kazlock quit (Ping timeout: 240 seconds) 2015-12-30T19:06:04Z Oladon joined #lisp 2015-12-30T19:09:47Z mlrutherford: is there anyway to save the result of (format t ~blahblah)? 2015-12-30T19:09:58Z mlrutherford: instead of just printing it 2015-12-30T19:10:18Z myrkraverk: mlrutherford: you can format to a string with nil instead of t. 2015-12-30T19:10:53Z mlrutherford: interesting. i'll have to play with that in a minute. thanks, friend :) 2015-12-30T19:12:35Z Guest81530 quit (Ping timeout: 240 seconds) 2015-12-30T19:16:06Z papachan quit (Ping timeout: 240 seconds) 2015-12-30T19:17:05Z Vulcan00 joined #lisp 2015-12-30T19:17:38Z PuercoPop: or use (with-output-to-string ) 2015-12-30T19:19:43Z ggole quit 2015-12-30T19:20:25Z Vulcan00 quit (Client Quit) 2015-12-30T19:21:09Z Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) 2015-12-30T19:21:12Z anti-freeze quit (Remote host closed the connection) 2015-12-30T19:22:52Z Ven joined #lisp 2015-12-30T19:26:29Z edgar-rft joined #lisp 2015-12-30T19:26:47Z Vulcan00 joined #lisp 2015-12-30T19:27:37Z shka quit (Read error: No route to host) 2015-12-30T19:28:00Z shka joined #lisp 2015-12-30T19:35:43Z anti-freeze joined #lisp 2015-12-30T19:38:08Z rpg quit (Quit: rpg) 2015-12-30T19:39:40Z OrangeShark joined #lisp 2015-12-30T19:45:44Z foom quit (Ping timeout: 250 seconds) 2015-12-30T19:46:07Z vlatkoB_ joined #lisp 2015-12-30T19:49:26Z EvW quit (Remote host closed the connection) 2015-12-30T19:49:34Z EvW joined #lisp 2015-12-30T19:49:54Z vlatkoB quit (Ping timeout: 272 seconds) 2015-12-30T19:49:56Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T19:50:27Z AlphaAtom quit (Quit: My Mac has gone to sleep. ZZZzzz…) 2015-12-30T19:50:58Z PuercoPop: is there an idiom for when one wants to run a cleanup form but the resource is bound to a name in a let at the beginning of the unwind-protect? All I can think of is to do an outer let and setf at the beginning of unwind-protect 2015-12-30T19:52:54Z Bicyclidine: you can just do (let ((foo (grab-resource ...))) (unwind-protect ... (release-resource foo))), can't you? it's not like you need to release the thing if the grab fails. 2015-12-30T19:54:29Z NeverDie joined #lisp 2015-12-30T19:54:38Z Posterdati quit (Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/) 2015-12-30T19:54:49Z PuercoPop: Bicyclidine: you are right 2015-12-30T19:55:17Z AlphaAtom joined #lisp 2015-12-30T19:56:19Z scottj joined #lisp 2015-12-30T19:56:59Z les quit (Quit: "") 2015-12-30T19:57:51Z synchromesh quit (Remote host closed the connection) 2015-12-30T19:58:40Z Posterdati joined #lisp 2015-12-30T19:58:41Z foom joined #lisp 2015-12-30T19:58:59Z vlatkoB_ quit (Remote host closed the connection) 2015-12-30T19:59:18Z les joined #lisp 2015-12-30T20:01:15Z Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) 2015-12-30T20:03:53Z Davidbrcz quit (Ping timeout: 276 seconds) 2015-12-30T20:05:39Z profess quit (Ping timeout: 260 seconds) 2015-12-30T20:06:06Z Davidbrcz joined #lisp 2015-12-30T20:07:10Z cadadar quit (Quit: Leaving.) 2015-12-30T20:08:34Z synchromesh joined #lisp 2015-12-30T20:12:21Z profess joined #lisp 2015-12-30T20:15:58Z znpy joined #lisp 2015-12-30T20:17:47Z lisse_ joined #lisp 2015-12-30T20:19:25Z znpy quit (Client Quit) 2015-12-30T20:22:32Z pwnie joined #lisp 2015-12-30T20:28:24Z jtza8 quit (Ping timeout: 264 seconds) 2015-12-30T20:28:51Z sysfault joined #lisp 2015-12-30T20:28:52Z sysfault quit (Max SendQ exceeded) 2015-12-30T20:29:17Z sysfault joined #lisp 2015-12-30T20:29:20Z Yuuhi quit (Remote host closed the connection) 2015-12-30T20:30:43Z gublet joined #lisp 2015-12-30T20:31:40Z gublet quit (Client Quit) 2015-12-30T20:31:54Z gublet joined #lisp 2015-12-30T20:32:48Z gublet quit (Client Quit) 2015-12-30T20:34:16Z kjeldahl quit (Ping timeout: 250 seconds) 2015-12-30T20:35:22Z kjeldahl joined #lisp 2015-12-30T20:39:05Z shka quit (Read error: Connection reset by peer) 2015-12-30T20:39:24Z shka joined #lisp 2015-12-30T20:41:05Z Jonsky quit (Quit: rcirc on GNU Emacs 24.5.1) 2015-12-30T20:43:00Z sysfault quit (Ping timeout: 260 seconds) 2015-12-30T20:45:27Z drichards quit (Remote host closed the connection) 2015-12-30T20:47:26Z yeticry quit (Quit: leaving) 2015-12-30T20:47:34Z cadadar joined #lisp 2015-12-30T20:47:40Z badkins_ joined #lisp 2015-12-30T20:47:46Z fourier joined #lisp 2015-12-30T20:48:25Z yeticry joined #lisp 2015-12-30T20:50:04Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T20:50:15Z badkins quit (Ping timeout: 240 seconds) 2015-12-30T20:54:34Z blt joined #lisp 2015-12-30T20:57:04Z Karl_Dscc quit (Remote host closed the connection) 2015-12-30T21:02:35Z kobain joined #lisp 2015-12-30T21:03:05Z freehck quit (Remote host closed the connection) 2015-12-30T21:08:17Z Th30n joined #lisp 2015-12-30T21:10:48Z jlarocco joined #lisp 2015-12-30T21:11:47Z Jagger joined #lisp 2015-12-30T21:13:58Z pwnie quit (Quit: = "") 2015-12-30T21:14:19Z jlarocco quit (Remote host closed the connection) 2015-12-30T21:15:16Z blt quit (Quit: WeeChat 1.3) 2015-12-30T21:16:54Z shka quit (Quit: Konversation terminated!) 2015-12-30T21:19:59Z Beetny joined #lisp 2015-12-30T21:29:35Z |3b|` is now known as |3b| 2015-12-30T21:30:58Z jtza8 joined #lisp 2015-12-30T21:36:16Z xorox90 quit (Quit: Connection closed for inactivity) 2015-12-30T21:36:24Z lisse_ joined #lisp 2015-12-30T21:37:24Z hiroakip quit (Remote host closed the connection) 2015-12-30T21:38:36Z bb010g quit (Quit: Connection closed for inactivity) 2015-12-30T21:39:53Z hiroakip joined #lisp 2015-12-30T21:41:40Z eudoxia joined #lisp 2015-12-30T21:43:49Z vxxe joined #lisp 2015-12-30T21:45:54Z Jagger left #lisp 2015-12-30T21:49:59Z earl-ducaine joined #lisp 2015-12-30T21:50:30Z thomas quit (Quit: leaving) 2015-12-30T21:53:53Z mlrutherford: is there anyway to get parse-integer to not give me the lenfth of the string? I just want the first return value 2015-12-30T21:54:46Z eudoxia: mlrutherford: in 'normal' code (e.g., outside the repl) the multiple values are ignored, only the first one is passed along 2015-12-30T21:55:24Z eudoxia: if you *really* want a single return value: (defun %parse-integer (string) (first (multiple-value-list (parse-integer string)))) 2015-12-30T21:55:50Z |3b|` joined #lisp 2015-12-30T21:55:51Z trinque joined #lisp 2015-12-30T21:55:55Z |3b| quit (Remote host closed the connection) 2015-12-30T21:56:31Z mlrutherford: looks like that worked, thanks a bunch :-) 2015-12-30T21:57:02Z mordocai quit (Ping timeout: 250 seconds) 2015-12-30T21:57:10Z trn quit (Quit: quit) 2015-12-30T21:57:31Z thomas joined #lisp 2015-12-30T21:58:54Z scottj quit (Quit: leaving) 2015-12-30T21:59:31Z sbryant quit (Ping timeout: 260 seconds) 2015-12-30T21:59:31Z sshirokov quit (Ping timeout: 260 seconds) 2015-12-30T22:01:19Z sbryant joined #lisp 2015-12-30T22:02:11Z zbigniew quit (Ping timeout: 276 seconds) 2015-12-30T22:02:13Z sshirokov joined #lisp 2015-12-30T22:02:25Z zbigniew joined #lisp 2015-12-30T22:04:46Z mordocai joined #lisp 2015-12-30T22:04:47Z zymurgy quit (Ping timeout: 276 seconds) 2015-12-30T22:05:28Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T22:06:56Z zbigniew quit (Ping timeout: 246 seconds) 2015-12-30T22:07:16Z lisse_ joined #lisp 2015-12-30T22:07:23Z sshirokov quit (Ping timeout: 276 seconds) 2015-12-30T22:08:00Z TMM joined #lisp 2015-12-30T22:08:08Z |3b|` quit (Read error: Connection reset by peer) 2015-12-30T22:08:36Z zbigniew joined #lisp 2015-12-30T22:09:19Z mordocai quit (Ping timeout: 260 seconds) 2015-12-30T22:09:47Z |3b|` joined #lisp 2015-12-30T22:10:33Z mordocai joined #lisp 2015-12-30T22:10:55Z oGMo: eudoxia: err that's terrible, either use NTH-VALUE or just (values ..) in this case to get the first and avoid massive consing 2015-12-30T22:11:17Z sbryant quit (Ping timeout: 276 seconds) 2015-12-30T22:11:19Z defaultxr joined #lisp 2015-12-30T22:11:27Z warweasle quit (Remote host closed the connection) 2015-12-30T22:11:40Z karbak quit (Ping timeout: 260 seconds) 2015-12-30T22:15:06Z pchrist quit (Ping timeout: 240 seconds) 2015-12-30T22:15:11Z ecraven quit (Ping timeout: 264 seconds) 2015-12-30T22:15:15Z hiroakip quit (Ping timeout: 265 seconds) 2015-12-30T22:15:46Z prxq quit (Remote host closed the connection) 2015-12-30T22:16:24Z chavezgu quit (Ping timeout: 264 seconds) 2015-12-30T22:16:39Z Subfusc quit (Ping timeout: 255 seconds) 2015-12-30T22:16:47Z mlrutherford: oGMo, what makes it terrible? 2015-12-30T22:17:08Z surrounder quit (Ping timeout: 276 seconds) 2015-12-30T22:18:02Z sshirokov joined #lisp 2015-12-30T22:18:07Z mlrutherford: also can ECL not bootstrap SBCL? 2015-12-30T22:18:20Z oGMo: mlrutherford: part of the purpose of VALUES is to facilitate multiple returns without consing up a list, a point which explicitly making a list defeats. and is also unnecessary since there are functions or forms to do what you want directly 2015-12-30T22:18:29Z schaueho quit (Ping timeout: 246 seconds) 2015-12-30T22:19:11Z futpib_ quit (Ping timeout: 246 seconds) 2015-12-30T22:19:27Z mlrutherford: oGMo, what functions would that be? read-from-string doesnt seem to do what i need it to 2015-12-30T22:19:35Z Th30n quit (Quit: Bye) 2015-12-30T22:19:44Z micro_ quit (Ping timeout: 276 seconds) 2015-12-30T22:19:50Z oGMo: er what are we talking about here 2015-12-30T22:20:11Z oGMo: i'm just talking about extracting a single return value 2015-12-30T22:20:16Z mlrutherford: converting a string into an integer 2015-12-30T22:20:22Z mlrutherford: oh ok, i get what you mean 2015-12-30T22:20:40Z oGMo: still use parse-integer heh 2015-12-30T22:21:13Z mlrutherford: mmkay, and replace multiple-values-list with nth-value? 2015-12-30T22:21:29Z Bicyclidine: actually, you just want the first value, so the usual idiom would be (values (parse-integer string)). 2015-12-30T22:21:45Z Bicyclidine: the rest of the time you'd use nth-value. i dunno what eudoxia was thinking. 2015-12-30T22:22:15Z sshirokov quit (Ping timeout: 240 seconds) 2015-12-30T22:22:16Z oGMo: Bicyclidine: right 2015-12-30T22:23:01Z jsgrant joined #lisp 2015-12-30T22:23:57Z pchrist joined #lisp 2015-12-30T22:24:01Z mlrutherford: hmm. that works too 2015-12-30T22:24:04Z mlrutherford: thanks yall 2015-12-30T22:24:35Z ecraven joined #lisp 2015-12-30T22:25:43Z chavezgu joined #lisp 2015-12-30T22:26:10Z surrounder joined #lisp 2015-12-30T22:26:13Z Subfusc joined #lisp 2015-12-30T22:26:26Z Xach_ joined #lisp 2015-12-30T22:26:36Z Xach quit (Read error: Connection reset by peer) 2015-12-30T22:26:57Z micro___ joined #lisp 2015-12-30T22:27:19Z eudoxia: oh, right 2015-12-30T22:27:26Z eudoxia: multiple-value-list creates a list 2015-12-30T22:27:33Z eudoxia: my bad folks i'm bad with memory 2015-12-30T22:27:35Z yuankode quit (Ping timeout: 240 seconds) 2015-12-30T22:27:41Z sbryant joined #lisp 2015-12-30T22:30:08Z sshirokov joined #lisp 2015-12-30T22:33:26Z attila_lendvai quit (Ping timeout: 240 seconds) 2015-12-30T22:34:42Z tbx joined #lisp 2015-12-30T22:35:33Z trinque left #lisp 2015-12-30T22:35:50Z Vulcan00 quit (Quit: Konversation terminated!) 2015-12-30T22:40:41Z badkins_ quit (Remote host closed the connection) 2015-12-30T22:42:24Z fourier quit (Quit: ERC (IRC client for Emacs 24.5.1)) 2015-12-30T22:42:47Z fourier joined #lisp 2015-12-30T22:43:59Z ecraven quit (Ping timeout: 264 seconds) 2015-12-30T22:44:44Z surrounder quit (Ping timeout: 265 seconds) 2015-12-30T22:44:44Z chavezgu quit (Ping timeout: 265 seconds) 2015-12-30T22:44:49Z s00pcan quit (Remote host closed the connection) 2015-12-30T22:45:08Z micro___ quit (Ping timeout: 250 seconds) 2015-12-30T22:45:44Z jtza8 quit (Remote host closed the connection) 2015-12-30T22:46:09Z LiamH quit (Quit: Leaving.) 2015-12-30T22:47:02Z s00pcan joined #lisp 2015-12-30T22:47:17Z pbgc joined #lisp 2015-12-30T22:48:52Z trn joined #lisp 2015-12-30T22:50:20Z surrounder joined #lisp 2015-12-30T22:50:35Z pchrist quit (Ping timeout: 240 seconds) 2015-12-30T22:52:10Z pchrist joined #lisp 2015-12-30T22:52:17Z ecraven joined #lisp 2015-12-30T22:52:22Z moore_ is now known as moore33 2015-12-30T22:52:23Z chavezgu joined #lisp 2015-12-30T22:53:44Z moore33 quit (Quit: Leaving) 2015-12-30T22:53:49Z micro___1 joined #lisp 2015-12-30T22:54:50Z tmtwd quit (Ping timeout: 272 seconds) 2015-12-30T23:00:38Z karbak joined #lisp 2015-12-30T23:07:34Z jasom: now I'm curious; on sbcl does the idiom (loop for (a b c) = (multiple-value-list (foo)) ...) cons up a list on every loop iteration? 2015-12-30T23:09:11Z mordocai: disassemble 2015-12-30T23:09:46Z jsgrant: mordocai: Just curious; Are you the guy on twitter, from Saint Louis? 2015-12-30T23:09:52Z mordocai: jsgrant: yep 2015-12-30T23:10:03Z Bicyclidine: it macroexpands into (let ((gensym (m-v-l ...))) (setf a (car gensym)) ...), so i'm guessing that yes it does 2015-12-30T23:10:04Z jsgrant: Cool, also from and in STL. :^) 2015-12-30T23:10:24Z mordocai: Also, I was just being cheeky with my response 2015-12-30T23:10:38Z karswell quit (Read error: Connection reset by peer) 2015-12-30T23:11:00Z jsgrant: mordocai: With me, or jasom ? 2015-12-30T23:11:29Z mordocai: jasom 2015-12-30T23:11:35Z karswell joined #lisp 2015-12-30T23:11:44Z malbertife quit (Ping timeout: 276 seconds) 2015-12-30T23:11:50Z pwnie joined #lisp 2015-12-30T23:12:06Z mordocai: jsgrant: https://twitter.com/_mordocai to be clear 2015-12-30T23:12:07Z jsgrant: mordocai: I was going to say, cheeky there to me would just be fibbing. X^D 2015-12-30T23:12:16Z pbgc quit (Quit: Computer has gone to sleep.) 2015-12-30T23:12:34Z jsgrant thinks he may be following you already. 2015-12-30T23:13:20Z fourier quit (Ping timeout: 255 seconds) 2015-12-30T23:17:34Z mordocai: jsgrant: You certainly are following me one way or another. 2015-12-30T23:17:46Z pbgc joined #lisp 2015-12-30T23:17:54Z mordocai: Also your website link is broken 2015-12-30T23:17:55Z Denommus quit (Quit: going home) 2015-12-30T23:18:46Z fourier joined #lisp 2015-12-30T23:21:13Z jsgrant: mordocai: Yeah, not missing much right now though as it would aim to an empty "Frog" generated blog that is currently hosted at https://jsgrant.github.io . That being said, I'm 'refactoring' it to a Coleslaw based site by the end of Janurary ... which, will hopefully have a gameplan of my self-learning plans for 2016. 2015-12-30T23:23:42Z araujo quit (Ping timeout: 255 seconds) 2015-12-30T23:24:32Z badkins joined #lisp 2015-12-30T23:24:36Z araujo joined #lisp 2015-12-30T23:24:37Z jasom: mordocai: it definitely allocates 2015-12-30T23:24:38Z mordocai: jsgrant: I should have some cool common lisp code to look at in the next week. Participating in http://itch.io/jam/january-2016-lisp-game-jam 2015-12-30T23:25:05Z jsgrant: mordocai: Using Cepl? 2015-12-30T23:25:58Z mordocai: jsgrant: I'm actually writing a wrapper for BearLibTerminal and plan on using that for the graphics and the rest custom. 2015-12-30T23:26:24Z Vulcan00 joined #lisp 2015-12-30T23:27:09Z jsgrant hopes the gamejam is hosted in '17 as well, I'd certainly allot some time to it; Jan is going to be way to busy to shove anything else in unfortunately. 2015-12-30T23:27:26Z jsgrant: mordocai: Have a concept already? 2015-12-30T23:28:59Z Guest6223 quit (Remote host closed the connection) 2015-12-30T23:29:58Z mordocai: jsgrant: Yeah, necromancer roguelike 2015-12-30T23:30:17Z mordocai: jsgrant: As a concept for my eventual dwarf fortress-like necromancer game 2015-12-30T23:31:11Z pwnie: tfw when you're conceptualizing something as a list rather than a set *tsk tsk tsk* 2015-12-30T23:36:13Z jsgrant: Sorry, was grabbing dinner; Will be back in less than 30. 2015-12-30T23:36:32Z Vulcan00 quit (Quit: Konversation terminated!) 2015-12-30T23:37:15Z mordocai: jsgrant: No problem, i'll be migrating from work to home shortly so will be online but not at the keyboard for a bit soon 2015-12-30T23:39:26Z phoe_krk quit (Quit: http://phoe-krk.tumblr.com/) 2015-12-30T23:41:29Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-12-30T23:41:56Z phoe_krk joined #lisp 2015-12-30T23:45:31Z lisse_ joined #lisp 2015-12-30T23:46:07Z mishoo__ quit (Ping timeout: 265 seconds) 2015-12-30T23:48:32Z evdubs joined #lisp 2015-12-30T23:48:46Z fourier quit (Ping timeout: 256 seconds) 2015-12-30T23:52:00Z goglosh joined #lisp 2015-12-30T23:52:54Z pbgc quit (Quit: Textual IRC Client: http://www.textualapp.com/) 2015-12-30T23:53:35Z lisse_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)