2015-10-23T00:00:11Z ryouma` quit (Remote host closed the connection) 2015-10-23T00:03:09Z Kenjin joined #lisp 2015-10-23T00:05:52Z johann_ joined #lisp 2015-10-23T00:06:44Z lispyone joined #lisp 2015-10-23T00:07:44Z Kenjin quit (Ping timeout: 244 seconds) 2015-10-23T00:10:59Z johann_ quit (Ping timeout: 264 seconds) 2015-10-23T00:11:21Z lispyone quit (Ping timeout: 255 seconds) 2015-10-23T00:19:30Z vap1 quit (Ping timeout: 240 seconds) 2015-10-23T00:21:06Z attila_lendvai quit (Ping timeout: 240 seconds) 2015-10-23T00:22:57Z vap1 joined #lisp 2015-10-23T00:27:59Z tmtwd joined #lisp 2015-10-23T00:28:55Z scymtym quit (Ping timeout: 244 seconds) 2015-10-23T00:30:07Z resttime joined #lisp 2015-10-23T00:31:04Z Niac joined #lisp 2015-10-23T00:41:15Z ziocroc2 quit (Quit: ziocroc2) 2015-10-23T00:42:51Z lispyone joined #lisp 2015-10-23T00:46:27Z Devon quit (Ping timeout: 255 seconds) 2015-10-23T00:48:09Z danlentz_ joined #lisp 2015-10-23T00:55:09Z lispyone quit (Remote host closed the connection) 2015-10-23T00:56:57Z sammwch joined #lisp 2015-10-23T00:58:22Z harish_ quit (Ping timeout: 244 seconds) 2015-10-23T00:58:35Z harish__ quit (Ping timeout: 256 seconds) 2015-10-23T00:58:52Z sammwch quit (Client Quit) 2015-10-23T00:59:09Z lisse quit (Ping timeout: 256 seconds) 2015-10-23T01:01:03Z sammwch joined #lisp 2015-10-23T01:01:27Z sammwch is now known as heddwch 2015-10-23T01:02:59Z bungoman quit (Ping timeout: 240 seconds) 2015-10-23T01:03:53Z Kenjin joined #lisp 2015-10-23T01:05:02Z araujo_ joined #lisp 2015-10-23T01:05:38Z araujo quit (Ping timeout: 252 seconds) 2015-10-23T01:06:33Z johann_ joined #lisp 2015-10-23T01:07:09Z tmtwd quit (Ping timeout: 255 seconds) 2015-10-23T01:08:58Z Kenjin quit (Ping timeout: 265 seconds) 2015-10-23T01:10:10Z chrisb quit (Ping timeout: 260 seconds) 2015-10-23T01:11:12Z johann_ quit (Ping timeout: 255 seconds) 2015-10-23T01:11:30Z sjl__ quit (Ping timeout: 252 seconds) 2015-10-23T01:19:36Z quazimodo quit (Ping timeout: 265 seconds) 2015-10-23T01:19:51Z smokeink joined #lisp 2015-10-23T01:20:00Z quazimod1 quit (Ping timeout: 272 seconds) 2015-10-23T01:26:35Z goglosh quit (Quit: ERC (IRC client for Emacs 24.5.1)) 2015-10-23T01:28:11Z dTal_ joined #lisp 2015-10-23T01:28:12Z leafybasil joined #lisp 2015-10-23T01:29:50Z dTal quit (Ping timeout: 240 seconds) 2015-10-23T01:31:56Z quazimodo joined #lisp 2015-10-23T01:32:03Z quazimod1 joined #lisp 2015-10-23T01:32:13Z fiddlerwoaroof: Does anyone here use cells? 2015-10-23T01:33:56Z leafybasil quit (Ping timeout: 272 seconds) 2015-10-23T01:34:47Z stardiviner joined #lisp 2015-10-23T01:36:25Z ryouma` joined #lisp 2015-10-23T01:37:00Z ryouma`: is there a sequence function to work like remove-NON-duplicates? i.e. take out every unique member of a list? 2015-10-23T01:43:14Z zacts joined #lisp 2015-10-23T01:46:40Z johann_ joined #lisp 2015-10-23T01:48:46Z pillton: fiddlerwoaroof: I have. 2015-10-23T01:49:05Z fiddlerwoaroof: pillton: I'm trying to figure out why an observer isn't firing 2015-10-23T01:49:20Z pillton: ryouma`: (set-difference X (remove-duplicates X)) 2015-10-23T01:49:47Z pillton: Oh wait. That is wrong. Sorry. 2015-10-23T01:50:28Z lispyone joined #lisp 2015-10-23T01:50:53Z ryouma`: pillton: yeah that seems like it would work but doesn't, as i discovered :) 2015-10-23T01:51:20Z blt joined #lisp 2015-10-23T01:51:21Z ryouma`: is there a bag-difference? 2015-10-23T01:51:28Z blt left #lisp 2015-10-23T01:51:52Z grouzen joined #lisp 2015-10-23T01:51:58Z pillton: ryouma`: You could do it with remove-duplicates, count, remove and set-difference. 2015-10-23T01:52:12Z fiddlerwoaroof: You could sort both lists and then compare them . .. 2015-10-23T01:52:14Z pillton: But, you may as well just write a loop. 2015-10-23T01:52:36Z pillton: fiddlerwoaroof: From what I can remember, observers only fire if the value changes. 2015-10-23T01:52:50Z fiddlerwoaroof: pillton: Do you have any idea why the "rate" observer isn't firing? Does the slot need to be ephemeral or something? http://paste.lisp.org/+3DDT 2015-10-23T01:52:56Z quazimod1 quit (Ping timeout: 246 seconds) 2015-10-23T01:53:54Z quazimodo quit (Ping timeout: 260 seconds) 2015-10-23T01:53:55Z fiddlerwoaroof: (BTW, the c?+n isn't right, it should be c-in, I forgot to change it before pasting) 2015-10-23T01:55:08Z lispyone quit (Ping timeout: 252 seconds) 2015-10-23T01:55:53Z danlentz_ quit (Quit: My Mac has gone to sleep. ZZZzzz…) 2015-10-23T01:56:43Z pillton: fiddlerwoarroof: I'm not sure you can initialise the cell slots that way. 2015-10-23T01:57:16Z pillton: fiddlerwoaroof: I think c-in and c? can only appear in defmodel. 2015-10-23T01:57:23Z aap quit (Read error: Connection reset by peer) 2015-10-23T01:57:50Z pillton: It has been a very long time since I used it. 2015-10-23T01:58:06Z yrdz quit (Remote host closed the connection) 2015-10-23T01:58:24Z yrdz joined #lisp 2015-10-23T01:58:24Z aap joined #lisp 2015-10-23T01:58:45Z fiddlerwoaroof: hmm, is the author still around? 2015-10-23T01:58:49Z pillton: Try making a controller model which composes the four objects together. 2015-10-23T02:00:09Z pillton: I think so. He isn't in #lisp though. 2015-10-23T02:00:40Z pillton: He used to be present on comp.lang.lisp when I was reading it 3-5 years ago. 2015-10-23T02:01:46Z fiddlerwoaroof: pillton: I'll try that, thanks for the help 2015-10-23T02:04:41Z Kenjin joined #lisp 2015-10-23T02:06:19Z quazimodo joined #lisp 2015-10-23T02:06:20Z quazimod1 joined #lisp 2015-10-23T02:07:00Z fiddlerwoaroof: pillton: that seems to work 2015-10-23T02:07:35Z bungoman_ joined #lisp 2015-10-23T02:09:09Z harish__ joined #lisp 2015-10-23T02:09:42Z Kenjin quit (Ping timeout: 268 seconds) 2015-10-23T02:11:09Z harish_ joined #lisp 2015-10-23T02:11:14Z Oladon joined #lisp 2015-10-23T02:18:01Z harish_ quit (Quit: Leaving) 2015-10-23T02:18:18Z harish joined #lisp 2015-10-23T02:23:43Z harish quit (Quit: Leaving) 2015-10-23T02:24:12Z harish joined #lisp 2015-10-23T02:26:48Z grouzen quit (Ping timeout: 255 seconds) 2015-10-23T02:35:12Z lisse joined #lisp 2015-10-23T02:35:12Z cosmicexplorer joined #lisp 2015-10-23T02:43:49Z zophy joined #lisp 2015-10-23T02:44:50Z stardiviner quit (Ping timeout: 240 seconds) 2015-10-23T02:45:35Z stardiviner joined #lisp 2015-10-23T02:52:37Z badkins quit 2015-10-23T03:03:42Z beach joined #lisp 2015-10-23T03:03:49Z beach: Good morning everyone! 2015-10-23T03:05:24Z Kenjin joined #lisp 2015-10-23T03:09:29Z sjl joined #lisp 2015-10-23T03:10:17Z Kenjin quit (Ping timeout: 265 seconds) 2015-10-23T03:11:54Z jason_m joined #lisp 2015-10-23T03:14:12Z tmtwd joined #lisp 2015-10-23T03:14:38Z sjl quit (Ping timeout: 272 seconds) 2015-10-23T03:15:30Z smokeink quit (Remote host closed the connection) 2015-10-23T03:20:43Z jason_m quit (Ping timeout: 260 seconds) 2015-10-23T03:29:35Z zophy quit (Ping timeout: 264 seconds) 2015-10-23T03:30:05Z zophy joined #lisp 2015-10-23T03:32:36Z drmeister: Hi beach 2015-10-23T03:32:58Z fiddlerwoaroof: How do I connect to swank on a different port? 2015-10-23T03:33:25Z fiddlerwoaroof: nvm 2015-10-23T03:33:44Z drmeister: beach: I think not enough of my useless instructions are being removed because I'm playing it too safe. 2015-10-23T03:34:33Z resttime: //join 2015-10-23T03:34:36Z beach: drmeister: Well, like I said, this algorithm is not great. 2015-10-23T03:34:43Z drmeister: The only criterion for instructing remove-useless-instructions is that instructions that have side-effects should not be removed? 2015-10-23T03:34:48Z beach: drmeister: It has a very primitive idea of "useless". 2015-10-23T03:34:57Z drmeister: I'm playing it very safe though. 2015-10-23T03:35:25Z drmeister: Actually, I'm playing it completely safe - none of my instructions can be removed 2015-10-23T03:35:29Z beach: Think about it this way: By default, an instruction is removed if its outputs are not used. 2015-10-23T03:35:41Z beach: So if you are OK with that, don't protect it. 2015-10-23T03:36:03Z drmeister: https://www.irccloud.com/pastebin/GHdX15u1/ 2015-10-23T03:37:03Z beach: What do the precalc instructions do? 2015-10-23T03:37:05Z drmeister: I think things like precalc-value-instruction and precalc-symbol-instruction can be removed 2015-10-23T03:37:18Z beach: I am thinking the same thing. 2015-10-23T03:37:23Z drmeister: They look up constants and literals in an array of precalculated values 2015-10-23T03:37:32Z beach: Yeah, they can probably be removed. 2015-10-23T03:37:43Z beach: The others look like they have side effects. 2015-10-23T03:38:00Z beach: Or otherwise should not be removed. 2015-10-23T03:38:01Z drmeister: Going down the list - do any others look like they can be removed? 2015-10-23T03:38:05Z beach: Like landing-pad. 2015-10-23T03:38:14Z lisse quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) 2015-10-23T03:38:19Z drmeister: Any function call can have side effects - of course 2015-10-23T03:38:21Z beach: landing-pad does not have side effects but should not be removed. 2015-10-23T03:38:50Z drmeister: I feel the same way - but how do you reason that? 2015-10-23T03:39:13Z beach: I am not reasoning, because I don't know exactly what they do. 2015-10-23T03:39:36Z drmeister: Ah 2015-10-23T03:39:50Z drmeister: What about push-special-binding and it's pop? 2015-10-23T03:40:04Z beach: That seems side-effect-y. 2015-10-23T03:40:43Z beach: setf-fdefinition too. 2015-10-23T03:40:50Z beach: throw as well. 2015-10-23T03:41:00Z beach: and unwind 2015-10-23T03:41:32Z beach: The only ones I am uncertain about are the landing-pad instructions. 2015-10-23T03:41:44Z beach: But I suspect they are essential. 2015-10-23T03:42:47Z drmeister: Ok, I'll remove the precalc-XXX instructions from the list of protected instructions and see what happens. 2015-10-23T03:43:07Z beach: They just look up values and write them to some location? 2015-10-23T03:43:11Z sunwukong joined #lisp 2015-10-23T03:43:28Z drmeister: It does remove some instructions when I use defmethod - just not enough 2015-10-23T03:43:40Z drmeister: I still see the closure 2015-10-23T03:43:52Z beach: That should definitely not happen. 2015-10-23T03:43:57Z drmeister: Hang on - I'll check - they may just return the value that they look up. 2015-10-23T03:44:05Z drmeister: What should definitely not happen? 2015-10-23T03:44:10Z drmeister: That the closure should remain? 2015-10-23T03:44:15Z beach: That an unused closure is in there. 2015-10-23T03:44:36Z beach: If a closure is unused, then the enclose-instruction produces a value that is not used. 2015-10-23T03:44:45Z beach: So then the enclose-instruction is removed. 2015-10-23T03:44:57Z beach: And therefore the reference to the function code it encloses. 2015-10-23T03:48:12Z zophy quit (Ping timeout: 272 seconds) 2015-10-23T03:49:53Z drmeister: It will take a while to compile everything to test it but here's an example: 2015-10-23T03:49:55Z drmeister: (clasp-cleavir:cleavir-compile 'a '(lambda () (defmethod foo (x y))) :debug t) 2015-10-23T03:50:22Z drmeister: https://usercontent.irccloud-cdn.com/file/qWgzHSXO/mir.pdf 2015-10-23T03:51:41Z drmeister: It's complicated MIR but I still see COMBINED-METHOD-ARGS and *NEXT-METHODS* in there 2015-10-23T03:51:58Z beach: I don't see CALL-NEXT-METHOD and NEXT-METHOD-P 2015-10-23T03:52:09Z beach: That was all it was designed to remove. 2015-10-23T03:52:38Z beach: Those two are not closures are they? 2015-10-23T03:53:03Z drmeister: Right - and those references are within precalc-symbol-ref - which were protected from removal - so it makes sense that they would still be there. 2015-10-23T03:53:05Z beach: the *NEXT-METHODS* is a special variable and COMBINED-METHOD-ARGS is also a variable. 2015-10-23T03:53:34Z drmeister: I thought they were involved with the closure - hang on. 2015-10-23T03:53:51Z beach: REMOVE-USELESS-INSTRUCTIONS is not doing magic. 2015-10-23T03:54:03Z beach: It just removes instructions with outputs that are not referred to. 2015-10-23T03:54:43Z beach: For instance, there is a FUNCALL in there that uses the result of those precalc instructions. 2015-10-23T03:55:02Z drmeister: This is the function that wraps a closure around the method lambda: 2015-10-23T03:55:04Z drmeister: https://www.irccloud.com/pastebin/LGpy2Dgi/ 2015-10-23T03:55:26Z drmeister: Indenting could be better - hang on. 2015-10-23T03:56:16Z beach: Can we do one thing at a time? 2015-10-23T03:56:43Z drmeister: http://paste.lisp.org/display/157318 2015-10-23T03:56:49Z drmeister: Which one thing at a time? 2015-10-23T03:56:55Z beach: I can't work like this. 2015-10-23T03:57:00Z beach: I am about to discuss the HIR with you. 2015-10-23T03:57:11Z beach: Look at the funcall:83 that creates Y. 2015-10-23T03:57:13Z drmeister: Oh - I thought this was related. 2015-10-23T03:57:27Z beach: It probably is, but I can't jump from one thing to the other like that. 2015-10-23T03:57:35Z beach: Look at the funcall:83 that creates Y. 2015-10-23T03:57:38Z drmeister: Ok, sorry. 2015-10-23T03:57:44Z drmeister: Looking. 2015-10-23T03:57:48Z beach: It is a FUNCALL, so it is not going to be removed. 2015-10-23T03:58:10Z beach: So the outputs of symbol-value and fdefinition are used. 2015-10-23T03:58:16Z beach: So they are not going to be removed either. 2015-10-23T03:58:25Z beach: So the output of the precalc are used. 2015-10-23T03:58:33Z beach: So they are not going to be removed either. 2015-10-23T03:58:45Z drmeister: You mean funcall:83 -1-> V ? 2015-10-23T03:58:51Z beach: Oh, V 2015-10-23T03:59:00Z beach: Hard to see with the blue background. 2015-10-23T03:59:01Z drmeister: That's the multiple value return 2015-10-23T03:59:04Z drmeister: Yeah. 2015-10-23T03:59:20Z drmeister: That's graphviz 2015-10-23T03:59:55Z drmeister: I follow - yes 2015-10-23T03:59:56Z beach: So the precalc are not going to be removed either, even if you unprotect them. 2015-10-23T04:00:13Z drmeister: Ah - ok. 2015-10-23T04:01:50Z emaczen quit (Ping timeout: 240 seconds) 2015-10-23T04:02:17Z beach: Again, all it was designed to do was to remove the two local functions that I recommended you leave in there, so that I would not be responsible for a recommendation that would slow down your code by creating useless closures. 2015-10-23T04:04:42Z beach: I am guessing that the COMBINED-METHOD-ARGS is a variable that is not just related to NEXT methods, but to ALL methods. 2015-10-23T04:05:30Z beach: Though, I see something that I could improve. 2015-10-23T04:05:41Z beach: There are multiple-values that are unused. 2015-10-23T04:05:59Z beach: I think I am currently only removing ordinary locations. 2015-10-23T04:06:10Z beach: That improvement would remove more instructions. 2015-10-23T04:06:10Z Kenjin joined #lisp 2015-10-23T04:06:26Z beach: Look at the blue V in the middle. 2015-10-23T04:06:35Z beach: It is being written to by many instructions. 2015-10-23T04:06:39Z beach: But it is not used. 2015-10-23T04:06:51Z drmeister: Yeah - I was just going to ask about that. 2015-10-23T04:06:56Z WaterOnMars joined #lisp 2015-10-23T04:07:08Z drmeister: No output - so it's useless to write to it. 2015-10-23T04:07:16Z beach: Definitely. 2015-10-23T04:07:23Z beach: I think that should be a simple improvement. 2015-10-23T04:08:09Z beach: Let me see what I can do during the day. 2015-10-23T04:09:23Z drmeister: Now the funcall:83 and funcall:118 - they will keep a lot of stuff from being removed. But they are funcalls to LIST and LISTP - no side-effects. What can be done about that? 2015-10-23T04:09:51Z beach: Something way more sophisticated than remove-useless-instructions was designed to do. 2015-10-23T04:09:54Z sjl joined #lisp 2015-10-23T04:10:43Z beach: It requires knowing what standard functions are side-effect free, and selectively removing FUNCALLs only when such functions are called. 2015-10-23T04:11:12Z drmeister: Does that mean that the closure will remain? And that every generic function call will cons memory? 2015-10-23T04:11:14Z Kenjin quit (Ping timeout: 260 seconds) 2015-10-23T04:11:27Z malbertife joined #lisp 2015-10-23T04:11:30Z cosmicexplorer quit (Ping timeout: 240 seconds) 2015-10-23T04:11:34Z drmeister: I'm asking because then I would start looking at other ways to avoid the closure, maybe by analyzing the AST from generate-ast. 2015-10-23T04:12:04Z beach: NEXT-METHOD-P and CALL-NEXT-METHOD will be removed, because they are not used, and this is detected by the fact that the ENCLOSE instruction produces a value that is not used. 2015-10-23T04:12:33Z sdothum quit (Quit: ZNC - 1.6.0 - http://znc.in) 2015-10-23T04:12:48Z beach: You keep saying "the closure" as if all closures should be removed. 2015-10-23T04:13:12Z beach: REMOVE-USELESS-INSTRUCTIONS was only designed to remove local functions that are not referred to. 2015-10-23T04:13:55Z beach: And it was designed to do that because I recommended you leave next-method-p and call-next-method in there, and I didn't want to be responsible for causing more consing because of that recommendation. 2015-10-23T04:13:56Z drmeister: Sorry - I'm thinking of the one closure that is added optionally by the ECL code based on it's code walking - which I don't like either. 2015-10-23T04:14:16Z beach: REMOVE-USELESS-INSTRUCTIONS was not designed to do anything else. 2015-10-23T04:14:23Z beach: It is a temporary solution. 2015-10-23T04:14:41Z drmeister: Don't worry about the responsibility thing - I see cleavir as a huge gift and I am very grateful for it. 2015-10-23T04:14:51Z sjl quit (Ping timeout: 260 seconds) 2015-10-23T04:15:05Z beach: I am trying to say that REMOVE-USELESS-INSTRUCTIONS is not a solution to all problems. 2015-10-23T04:15:14Z drmeister: I'm just trying to speed up the cleavir compilation and I think the allocations that are going on in every generic function is a drag on compilation. 2015-10-23T04:16:19Z drmeister: I understand. I'm still trying to figure out if it will solve this one problem - it may. It hasn't really had a chance yet. 2015-10-23T04:16:33Z beach: Yes it has. 2015-10-23T04:16:45Z beach: next-method-p and call-next-method are no longer in there. 2015-10-23T04:17:01Z beach: And that is what REMOVE-USELESS-INSTRUCTIONS was designed to remove. 2015-10-23T04:18:42Z drmeister: Oh - click - I see that now. tracing didn't seem to remove enough instructions for that but I'll look at that more closely. 2015-10-23T04:19:26Z drmeister: I was focused on the (let ((.closed-combined-method-args. ...) (.next-methods. ...)) ...) 2015-10-23T04:19:30Z beach: If the code walker removes something more than what REMOVE-USELESS-INSTRUCTIONS does then I need to know about it, so that I can determine whether to make a different recommendation, like keeping the code walker or improving REMOVE-USELESS-INSTRUCTIONS or something else. 2015-10-23T04:21:10Z drmeister: Ok, then yes, I think the code walker would remove more than REMOVE-USELESS-INSTRUCTIONS will do at this point. The paste I put up shows what the result of code-walking will wrap around the method lambda - it's a LET and an FLET. REMOVE-USELESS-INSTRUCTIONS is removing the FLET but I don't think it's doing the LET part. 2015-10-23T04:21:24Z drmeister: http://paste.lisp.org/display/157318 2015-10-23T04:21:57Z hydan quit (Remote host closed the connection) 2015-10-23T04:22:26Z hydan joined #lisp 2015-10-23T04:23:07Z beach: Do you expect .closed-combined-method-args. to be removed? 2015-10-23T04:23:13Z drmeister: I think it's the calls to (LISTP .combined-method-args.) and (APPLY #'LIST .combined-method-args.) that will prevent this from being removed. 2015-10-23T04:23:42Z drmeister: I would love it to be removed. I don't expect it to. That is my dilemma. 2015-10-23T04:23:52Z beach: Hold on. 2015-10-23T04:24:01Z beach: The name suggests that it contains the arguments to the method. 2015-10-23T04:24:08Z drmeister: Yes. 2015-10-23T04:24:12Z beach: If so, it would not be wise to wish for it to be removed. 2015-10-23T04:24:30Z aretecode quit (Quit: Toodaloo) 2015-10-23T04:24:54Z mac_ified quit 2015-10-23T04:24:59Z drmeister: I see. But the code walker would eliminate all of this from being wrapped around the method-lambda in the first place. So somehow ECL gets by without it. 2015-10-23T04:25:13Z drmeister: May I paste one more snippet of code? 2015-10-23T04:25:19Z beach: Sure. 2015-10-23T04:25:27Z drmeister: Thank you - hang on. 2015-10-23T04:26:21Z drmeister: http://paste.lisp.org/display/157318#1 2015-10-23T04:27:09Z drmeister: This is the function that walks the code - and (if in-closure-p ...) calls the previous function I pasted to wrap the method-lambda in the closure. 2015-10-23T04:27:28Z munksgaard joined #lisp 2015-10-23T04:27:30Z beach: I think I see. 2015-10-23T04:28:11Z bungoman_ quit 2015-10-23T04:28:14Z beach: I think you should keep the code walker, because you want something that remove-useless-instructions was not designed to do. 2015-10-23T04:29:12Z drmeister: Ah - ok. That leads to my next question - I can't code walk in cclasp. Can I get the same effect by inspecting the AST generated by generate-ast? 2015-10-23T04:29:41Z tmtwd quit (Ping timeout: 244 seconds) 2015-10-23T04:29:45Z beach: That ought to be possible. 2015-10-23T04:30:08Z drmeister: ECL does a really dirty hack where they invoke their compiler and provide it a callback that gets called for each form and the callback is provided the form and the lexical environment. 2015-10-23T04:30:42Z drmeister: I followed their lead and I call the bclasp compiler to walk the code and then throw away the generated code - it's awful. 2015-10-23T04:31:06Z drmeister: The AST from generate-ast doesn't have any environments once it's generated. 2015-10-23T04:31:28Z beach: Right. And the environment should not be necessary. 2015-10-23T04:32:00Z drmeister: So I was thinking I would walk the AST and look for CALL-NEXT-METHOD inside a FUNCTION inside a FUNCTION - that would indicate that the CALL-NEXT-METHOD may escape. Does that sound reasonable? 2015-10-23T04:32:04Z beach: All the information is in the AST. 2015-10-23T04:32:33Z beach: It ought to be possible. 2015-10-23T04:33:28Z araujo_ quit (Quit: Leaving) 2015-10-23T04:33:30Z beach: Not sure your decision procedure is the correct one. 2015-10-23T04:33:44Z drmeister: Do you have any recommendations? 2015-10-23T04:34:01Z beach: Tough question. 2015-10-23T04:34:53Z araujo joined #lisp 2015-10-23T04:34:53Z araujo quit (Changing host) 2015-10-23T04:34:53Z araujo joined #lisp 2015-10-23T04:35:03Z drmeister: Right, and I confess that I have 100% confidence that I understand what the ECL code-walker is looking for. I'm pretty sure they just want to know if a CALL-NEXT-METHOD call can escape the method call. 2015-10-23T04:35:51Z beach: My recommendation would be to do it in the HIR by a more powerful dead-code elimination technique that needs to be in there anyway. The problem is that you need a kludge NOW. I thought REMOVE-USELESS-INSTRUCTIONS was good enough, but it isn't. So now we are discussing more sophisticated kludges that would ultimately be thrown away. 2015-10-23T04:35:54Z drmeister: Obviously it's safe to always wrap the method lambda inside this closure. But that's way too many false positives and slows everything down. 2015-10-23T04:36:09Z drmeister: It's allocating something like 1K/generic function call. 2015-10-23T04:36:55Z beach: In the AST, you should look for the value produced by the function-ast being used or not. 2015-10-23T04:37:05Z beach: That decision procedure is at least correct. 2015-10-23T04:37:13Z beach: If the value is nowhere used, you can remove it. 2015-10-23T04:37:27Z drmeister: I'll think on that. 2015-10-23T04:37:35Z drmeister: https://usercontent.irccloud-cdn.com/file/Pa9b7Z38/ast.png 2015-10-23T04:37:41Z beach: It is the same thing I do in REMOVE-USELESS-INSTRUCTIONS. 2015-10-23T04:37:47Z drmeister: That is the AST - it is mucho-complicated. 2015-10-23T04:38:04Z drmeister: But you analyze HIR. 2015-10-23T04:38:12Z beach: Yes. 2015-10-23T04:38:23Z beach: I do that because I think it is the right thing to do. 2015-10-23T04:38:41Z beach: But it is hard for me to think of solutions conditioned by temporary kludges. 2015-10-23T04:39:03Z drmeister: Actually, now that I think about it. This is the AST with the closure - the AST of the original method will be simpler. 2015-10-23T04:39:30Z beach: I am lost. 2015-10-23T04:39:37Z nikki93 joined #lisp 2015-10-23T04:39:40Z beach: "the closure" "original" 2015-10-23T04:40:03Z drmeister: The method lambda prior to being wrapped in this closure. 2015-10-23T04:40:06Z cabaire joined #lisp 2015-10-23T04:40:19Z drmeister: The closure code I pasted. 2015-10-23T04:40:57Z drmeister: So in the best of all worlds, how would Cleavir optimize this situation? 2015-10-23T04:41:27Z beach: So ECL does the opposite to what REMOVE-USELESS-INSTRUCTIONS does, i.e., it assumes CALL-NEXT-METHOD is not being used, and if it turns out it is, the body gets wrapped? 2015-10-23T04:41:37Z drmeister: Yup 2015-10-23T04:42:44Z beach: Like I said, Cleavir would have a more general dead-code elimination pass that works on HIR. It would know that LISTP is without side effects so it would remove function calls that produce values that are not used and that are without side effects. 2015-10-23T04:43:06Z beach: It would also have a better way of detecting "not used" than REMOVE-USELESS-INSTRUCTIONS has. 2015-10-23T04:43:10Z drmeister: It occurs to me: Another alternative would be to change the wrapper so that it is more amenable to removal by remove-useless-instructions. Somehow get rid of the calls to LISTP and LIST 2015-10-23T04:44:45Z drmeister: That's kind of what you were expecting that REMOVE-USELESS-INSTRUCTIONS would be operating on - wasn't it? The extra LET that calls LISTP and LIST requires more sophisticated machinery to remove it. 2015-10-23T04:45:48Z beach: REMOVE-USELESS-INSTRUCTIONS was only designed to remove the ENCLOSE instructions that produce the closures for NEXT-METHOD-P and CALL-NEXT-METHOD when those local functions are not used. 2015-10-23T04:46:20Z mbuf joined #lisp 2015-10-23T04:46:20Z beach: I knew that the simple test for "not used" that REMOVE-USELESS-INSTRUCTIONS used would be good enough for that. 2015-10-23T04:48:02Z beach: Now, it turns out, that's not good enough for what you want. 2015-10-23T04:50:07Z drmeister: Now that I think about it: What the heck is this problematic code doing anyway? (if (listp .combined-method-args.) .combined-method-args. (apply #'list .combined-method-args.)) 2015-10-23T04:50:45Z drmeister: It's testing if .combined-method-args. is a list and if so using it and if not doing (apply #'list .combined-method-args.) ???? 2015-10-23T04:51:13Z beach: Looks strange. 2015-10-23T04:51:30Z nikki93 quit (Remote host closed the connection) 2015-10-23T04:51:48Z beach: How can it apply #'list to it if it is not a list? 2015-10-23T04:51:52Z drmeister: I wonder if .combinded-method-args. may be something other than a list, something like a C va_list like I just implemented as an optimization. 2015-10-23T04:51:53Z smokeink joined #lisp 2015-10-23T04:52:25Z drmeister: Hmm, I think that's the only thing it could be! 2015-10-23T04:53:13Z beach: I am not quite awake yet, but it seems to me that this code would fail if it is not a list. No? 2015-10-23T04:53:40Z Octothorpe joined #lisp 2015-10-23T04:53:49Z drmeister: Not if they altered APPLY to accept some sort of implementation dependent list as its last argument. I did exactly this. 2015-10-23T04:54:00Z beach: Wow. OK. 2015-10-23T04:54:22Z drmeister: The C va_list varargs struct lets you iterate over arguments on the stack. 2015-10-23T04:54:44Z drmeister: jackdaniel: Are you online? 2015-10-23T04:55:10Z drmeister: Are there any ECL users who might be familiar with the internals online? 2015-10-23T04:55:49Z tmtwd joined #lisp 2015-10-23T04:56:03Z drmeister: I'll go dig into the code - but I'm 99% sure that this is what's going on. It makes a lot of sense coming from a C/C++ world view. 2015-10-23T04:56:41Z drmeister: Can I use this? Pondering... 2015-10-23T04:57:09Z cabaire quit (Ping timeout: 256 seconds) 2015-10-23T04:57:50Z drmeister: I could implement a primitive that returns a canonical CL list given either a CL list or a va_list and tell REMOVE-USELESS-INSTRUCTIONS that it is removable. 2015-10-23T04:58:01Z drmeister: Cover your eyes beach - you won't want to see this! 2015-10-23T04:58:32Z drmeister: Being a C++ programmer means you have to get dirty once in a while. 2015-10-23T04:59:37Z drmeister: I'll sleep on it before I do something like that. That would be a hack on top of a hack. But it's alluring because it would let REMOVE-USELESS-INSTRUCTIONS do the job. 2015-10-23T05:01:05Z drmeister: Something like ENSURE-LIST 2015-10-23T05:01:12Z Yuuhi joined #lisp 2015-10-23T05:02:43Z Octothorpe is now known as cabaire 2015-10-23T05:03:50Z beach: Do you need me for anything else right now? 2015-10-23T05:04:57Z drmeister: beach - no, but thank you very, very much. 2015-10-23T05:05:05Z beach: OK, talk later. 2015-10-23T05:05:28Z drmeister: This was very illuminating. It think the only reason REMOVE-USELESS-INSTRUCTIONS didn't do the job is because it's operating on non-standard code. 2015-10-23T05:05:29Z kobain quit (Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/) 2015-10-23T05:06:16Z oleo quit (Quit: Verlassend) 2015-10-23T05:06:27Z drmeister: It's a kludge/optimization of ECL that I may have just reinvented. The only reason I recognize it is because I just reinvented it. 2015-10-23T05:06:38Z drmeister: Thank you - have fun! 2015-10-23T05:07:29Z samssammerz joined #lisp 2015-10-23T05:12:15Z munksgaard quit (Read error: Connection reset by peer) 2015-10-23T05:15:30Z jackdaniel: drmeister: I'm online right now :) 2015-10-23T05:16:21Z drmeister: jackdaniel: Hi 2015-10-23T05:16:34Z jackdaniel: o/ 2015-10-23T05:16:49Z drmeister: I have a really technical ECL question and I totally understand if you haven't dug into this part of the code. 2015-10-23T05:17:07Z drmeister: Does ECL have some way of representing C varargs lists in CL? 2015-10-23T05:17:25Z drmeister: There is some weird code in method.lsp that I can only understand in terms of that. 2015-10-23T05:17:34Z drmeister: (if (listp .combined-method-args.) .combined-method-args. (apply #'list .combined-method-args.)) 2015-10-23T05:18:13Z drmeister: It defines part of a closure that is wrapped around method lambdas depending on the results of code-walking the method-lambda. 2015-10-23T05:18:44Z drmeister: If .combined-method-args. is not a list then how can ECL (apply #'list .combined-method-args.) ? 2015-10-23T05:20:41Z jackdaniel: hrm, give me a second 2015-10-23T05:20:52Z drmeister: No problem. 2015-10-23T05:21:15Z shookees quit (Quit: TATA AND FAREWELL) 2015-10-23T05:23:02Z jackdaniel: drmeister: check the `apply.d' file 2015-10-23T05:24:42Z drmeister: Yes, I don't see anything that explains the above. Is the apply in apply.d the Common Lisp APPLY? 2015-10-23T05:25:45Z jackdaniel: it is from the C perspective I think 2015-10-23T05:26:19Z jackdaniel: there is also ecl_apply_from_stack_frame 2015-10-23T05:26:33Z jackdaniel: in eval.d 2015-10-23T05:26:37Z earl-ducaine quit (Ping timeout: 256 seconds) 2015-10-23T05:26:53Z jackdaniel: and the #'apply from the lisp perspective 2015-10-23T05:27:09Z jackdaniel: and I think it's what you look for 2015-10-23T05:27:21Z jackdaniel: eval.d#137 2015-10-23T05:27:41Z jackdaniel: yes, it works on the stack frames 2015-10-23T05:28:15Z tmtwd quit (Ping timeout: 260 seconds) 2015-10-23T05:29:40Z jackdaniel: evaluating stack frame args works like: (let ((sp frame-base) (narg frame-size)) (APPLY narg function sp)) where apply behaves like the function in apply.d file 2015-10-23T05:35:51Z drmeister: Ok, it's very late for me. I'll look into it tomorrow. 2015-10-23T05:35:56Z drmeister: Thank you 2015-10-23T05:36:08Z jackdaniel: sure thing. Good night (morning here ^_^) 2015-10-23T05:42:05Z ramky joined #lisp 2015-10-23T05:42:23Z pt1 joined #lisp 2015-10-23T05:42:48Z Kenjin joined #lisp 2015-10-23T05:43:11Z beach left #lisp 2015-10-23T05:43:35Z zophy joined #lisp 2015-10-23T05:49:36Z johann_ quit (Remote host closed the connection) 2015-10-23T05:51:33Z Shinmera joined #lisp 2015-10-23T05:52:06Z ryu0 joined #lisp 2015-10-23T05:52:45Z Oladon quit (Read error: Connection reset by peer) 2015-10-23T05:57:01Z zophy quit (Quit: Leaving) 2015-10-23T05:58:21Z Whymind quit (Read error: Connection reset by peer) 2015-10-23T05:58:44Z Whymind joined #lisp 2015-10-23T06:00:59Z mishoo_ joined #lisp 2015-10-23T06:01:45Z knicklux quit (Ping timeout: 256 seconds) 2015-10-23T06:01:57Z pt1 quit (Remote host closed the connection) 2015-10-23T06:02:22Z knicklux joined #lisp 2015-10-23T06:08:53Z vlatkoB joined #lisp 2015-10-23T06:10:39Z sjl joined #lisp 2015-10-23T06:15:28Z sjl quit (Ping timeout: 252 seconds) 2015-10-23T06:18:18Z cadadar_ joined #lisp 2015-10-23T06:19:05Z yeticry quit (Read error: Connection reset by peer) 2015-10-23T06:19:31Z ehu joined #lisp 2015-10-23T06:20:56Z yeticry joined #lisp 2015-10-23T06:22:11Z __Greg joined #lisp 2015-10-23T06:22:15Z __Greg left #lisp 2015-10-23T06:22:35Z mrSpec joined #lisp 2015-10-23T06:23:11Z DrCode joined #lisp 2015-10-23T06:30:46Z defaultxr quit (Quit: gnight) 2015-10-23T06:32:14Z ogamita joined #lisp 2015-10-23T06:32:48Z harish quit (Ping timeout: 265 seconds) 2015-10-23T06:33:17Z harish__ quit (Ping timeout: 265 seconds) 2015-10-23T06:34:12Z flambard joined #lisp 2015-10-23T06:34:23Z fridim_ joined #lisp 2015-10-23T06:34:59Z ramky quit (Ping timeout: 264 seconds) 2015-10-23T06:38:37Z Ven joined #lisp 2015-10-23T06:39:08Z WaterOnMars quit (Quit: Connection closed for inactivity) 2015-10-23T06:41:03Z pjb: ryouma`: you could use com.informatimago.common-lisp.cesarum.sequence:duplicates 2015-10-23T06:42:07Z pjb: ryouma`: but it may be not what you want: (duplicates '(1 2 3 2 3 2)) #| --> (3 2) |# a single 2. 2015-10-23T06:43:37Z pt1 joined #lisp 2015-10-23T06:44:24Z malbertife quit (Ping timeout: 265 seconds) 2015-10-23T06:46:27Z blubjr: i think (set-difference l (duplicates l)) is what they wanted 2015-10-23T06:46:34Z ramky joined #lisp 2015-10-23T06:50:25Z johann_ joined #lisp 2015-10-23T06:51:17Z psy_ joined #lisp 2015-10-23T06:54:11Z HDurer quit (Ping timeout: 264 seconds) 2015-10-23T06:54:43Z earl-ducaine joined #lisp 2015-10-23T06:55:14Z johann_ quit (Ping timeout: 268 seconds) 2015-10-23T06:56:52Z pjb: blubjr: no, that would be remove-duplicates. 2015-10-23T06:57:51Z blubjr: (set-difference l (remove-duplicates l)) will always return nil 2015-10-23T06:57:59Z pjb: (let ((x '(1 2 3 2 3 2))) (set-difference X (remove-duplicates X))) #| --> nil |# 2015-10-23T06:58:07Z pjb: indeed. 2015-10-23T06:58:14Z blubjr: they wanted non duplicate elements only 2015-10-23T06:58:17Z pjb: (let ((x '(1 2 3 2 3 2))) (set-difference X (duplicates X))) #| --> (1) |# 2015-10-23T06:58:23Z blubjr: yes 2015-10-23T06:58:34Z pjb: (let ((x '(1 2 3 2 3 2))) (set-difference X (set-difference X (duplicates X)))) #| --> (2 3 2 3 2) |# 2015-10-23T06:58:52Z pjb: That must be this. 2015-10-23T06:59:07Z quazimod1 quit (Ping timeout: 260 seconds) 2015-10-23T06:59:35Z quazimodo quit (Ping timeout: 260 seconds) 2015-10-23T07:02:41Z ehu quit (Quit: Leaving.) 2015-10-23T07:02:46Z HDurer joined #lisp 2015-10-23T07:05:45Z _cosmonaut_ joined #lisp 2015-10-23T07:05:57Z ryouma` quit (Remote host closed the connection) 2015-10-23T07:09:21Z mathrick joined #lisp 2015-10-23T07:14:15Z leafybasil joined #lisp 2015-10-23T07:14:52Z mvilleneuve joined #lisp 2015-10-23T07:15:06Z ramky quit (Ping timeout: 260 seconds) 2015-10-23T07:16:07Z Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) 2015-10-23T07:17:27Z Ven joined #lisp 2015-10-23T07:18:25Z Ven quit (Client Quit) 2015-10-23T07:18:51Z leafybasil quit (Ping timeout: 255 seconds) 2015-10-23T07:26:06Z radioninja quit (Ping timeout: 250 seconds) 2015-10-23T07:26:26Z sjl joined #lisp 2015-10-23T07:27:44Z Ven joined #lisp 2015-10-23T07:30:33Z mathrick quit (Ping timeout: 255 seconds) 2015-10-23T07:30:40Z ramky joined #lisp 2015-10-23T07:31:00Z sjl quit (Ping timeout: 255 seconds) 2015-10-23T07:33:36Z xrash quit (Remote host closed the connection) 2015-10-23T07:34:20Z Cymew joined #lisp 2015-10-23T07:35:32Z hazz joined #lisp 2015-10-23T07:36:17Z snv joined #lisp 2015-10-23T07:39:52Z mrSpec quit (Read error: No route to host) 2015-10-23T07:41:00Z keen______ quit (Read error: Connection reset by peer) 2015-10-23T07:41:26Z HDurer quit (Ping timeout: 240 seconds) 2015-10-23T07:41:37Z happy-dude quit (Quit: Connection closed for inactivity) 2015-10-23T07:41:42Z _sjs quit (Ping timeout: 260 seconds) 2015-10-23T07:41:48Z ZabaQ joined #lisp 2015-10-23T07:42:46Z keen______ joined #lisp 2015-10-23T07:43:21Z mathrick joined #lisp 2015-10-23T07:44:55Z _sjs joined #lisp 2015-10-23T07:45:47Z fiddlerwoaroof quit (Ping timeout: 264 seconds) 2015-10-23T07:46:33Z mrSpec joined #lisp 2015-10-23T07:48:56Z fiddlerwoaroof joined #lisp 2015-10-23T07:49:31Z Karl_Dscc joined #lisp 2015-10-23T07:51:12Z johann_ joined #lisp 2015-10-23T07:55:38Z pt1 quit (Remote host closed the connection) 2015-10-23T07:55:45Z johann_ quit (Ping timeout: 255 seconds) 2015-10-23T07:56:12Z rszeno quit (Quit: Leaving.) 2015-10-23T07:56:19Z HDurer joined #lisp 2015-10-23T07:57:07Z dytrivedi joined #lisp 2015-10-23T07:58:58Z snv quit (Ping timeout: 260 seconds) 2015-10-23T08:06:28Z Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) 2015-10-23T08:07:00Z loke quit (Ping timeout: 255 seconds) 2015-10-23T08:12:18Z ehu joined #lisp 2015-10-23T08:14:41Z remi`bd joined #lisp 2015-10-23T08:15:02Z preacherAKAnd joined #lisp 2015-10-23T08:15:46Z ineiros quit (Ping timeout: 260 seconds) 2015-10-23T08:16:22Z radioninja joined #lisp 2015-10-23T08:16:24Z Ven joined #lisp 2015-10-23T08:16:45Z pt1 joined #lisp 2015-10-23T08:17:26Z dytrivedi quit (Quit: dytrivedi) 2015-10-23T08:18:06Z mrSpec quit (Ping timeout: 260 seconds) 2015-10-23T08:19:25Z loke joined #lisp 2015-10-23T08:20:31Z elderK joined #lisp 2015-10-23T08:21:14Z knobo joined #lisp 2015-10-23T08:23:58Z ASau quit (Ping timeout: 265 seconds) 2015-10-23T08:25:34Z Karl_Dscc quit (Remote host closed the connection) 2015-10-23T08:27:10Z sjl joined #lisp 2015-10-23T08:31:23Z pt1 quit (Remote host closed the connection) 2015-10-23T08:31:56Z sjl quit (Ping timeout: 246 seconds) 2015-10-23T08:32:34Z pt1 joined #lisp 2015-10-23T08:32:38Z mrSpec joined #lisp 2015-10-23T08:34:42Z leafybasil joined #lisp 2015-10-23T08:39:21Z sunwukong quit (Quit: Leaving) 2015-10-23T08:42:11Z leafybasil quit (Remote host closed the connection) 2015-10-23T08:42:37Z leafybasil joined #lisp 2015-10-23T08:43:03Z lisp174 joined #lisp 2015-10-23T08:43:25Z lisp174: Hello. 2015-10-23T08:43:37Z blubjr: hi lisp 174 2015-10-23T08:43:41Z lisp174: Macros are simply functions that run at compile time, yes? 2015-10-23T08:43:58Z jackdaniel: lisp174: yes 2015-10-23T08:44:32Z jackdaniel: well, no, you can make them run at different times as well. But generally yes :) 2015-10-23T08:44:32Z loke: lisp174: Kinda, sorta. Yes. 2015-10-23T08:44:46Z lisp174: However, is this valid? (define (foo) (exit)) (define-macro (disaster) (foo) '(void)) (define (subversive) (disaster)) 2015-10-23T08:44:47Z loke: lisp174: The spec doesn't actually guarantee when they run. 2015-10-23T08:44:56Z lisp174: where (exit) terminates execution. 2015-10-23T08:44:59Z loke: lisp174: That's illegal Lisp code. 2015-10-23T08:45:05Z loke: you define macros using DEFMACRO 2015-10-23T08:45:15Z lisp174: Humor me on the syntax, sorry. :) 2015-10-23T08:45:15Z loke: lisp174: That looks like Scheme code, in fact. 2015-10-23T08:45:42Z lisp174: Sure, let's say my example was common lisp, and used defmacro. 2015-10-23T08:46:06Z jackdaniel: and defun 2015-10-23T08:46:11Z loke: lisp174: Right, then you have to write a proper example, but I can't guess what your invented syntax is supposed to mean. 2015-10-23T08:46:42Z loke: lisp174: Or, you have to express your question in a way that gives us a chance to understand it. 2015-10-23T08:46:49Z lisp174: (defun foo () (exit) (defmacro disaster () '(do-nothing)) (defun subversive () (disaster)) 2015-10-23T08:47:03Z pt1 quit (Remote host closed the connection) 2015-10-23T08:47:10Z lisp174: er. 2015-10-23T08:47:14Z zacharias joined #lisp 2015-10-23T08:47:15Z lisp174: (defun foo () (exit) (defmacro disaster () (foo) '(do-nothing)) (defun subversive () (disaster)) 2015-10-23T08:47:46Z jackdaniel: what does exit do? o_O 2015-10-23T08:47:52Z lisp174: terminates execution. 2015-10-23T08:47:57Z Shinmera: You're still missing a paren to close the foo defun. 2015-10-23T08:48:02Z lisp174: Heh. 2015-10-23T08:48:29Z lisp174: I apologize for wasting everyone's time -- I should have prepared the question more carefully 2015-10-23T08:48:34Z Shinmera: But, if you eval that code or compile it, it would indeed exit. 2015-10-23T08:49:10Z lisp174: So, here's the mystery: Does scheme's `define-syntax` allow you to do the equivalent of that? 2015-10-23T08:49:24Z Shinmera: Presuming that EXIT is a function your implementation provides, since it's not in the CL standard. 2015-10-23T08:49:29Z loke: Shinmera: Well, if he compiles it he'll get an error since the macro can't see the FOO function. 2015-10-23T08:49:36Z loke: He'd have to wrap FOO in an EVAL-WHEN 2015-10-23T08:49:38Z lisp174: loke: that is the heart of my question. 2015-10-23T08:49:39Z Shinmera: loke: Ah, right. 2015-10-23T08:49:53Z lisp174: Is that so? I see. 2015-10-23T08:50:06Z Shinmera: clhs defun 2015-10-23T08:50:07Z specbot: http://www.lispworks.com/reference/HyperSpec/Body/m_defun.htm 2015-10-23T08:50:15Z Shinmera: "defun is not required to perform any compile-time side effects. In particular, defun does not make the function definition available at compile time. An implementation may choose to store information about the function for the purposes of compile-time error-checking (such as checking the number of arguments on calls), or to enable the function to be expanded inline." 2015-10-23T08:50:33Z lisp174: In that case, why is it possible to write, in scheme, a `define-syntax` macro which calls a function that is `define`'d in the very same file? 2015-10-23T08:50:42Z ehu1 joined #lisp 2015-10-23T08:51:02Z ehu quit (Ping timeout: 250 seconds) 2015-10-23T08:51:03Z lisp174: (It is indeed possible to do that in scheme, which is the source of my confusion tonight.) 2015-10-23T08:51:05Z Shinmera: Well this channel is for CL, but in that case: 2015-10-23T08:51:07Z Shinmera: clhs defmacro 2015-10-23T08:51:07Z specbot: http://www.lispworks.com/reference/HyperSpec/Body/m_defmac.htm 2015-10-23T08:51:09Z lisp174: And thank you for the clarity. 2015-10-23T08:51:12Z Shinmera: "If a defmacro form appears as a top level form, the compiler must store the macro definition at compile time, so that occurrences of the macro later on in the file can be expanded correctly. Users must ensure that the body of the macro can be evaluated at compile time if it is referenced within the file being compiled." 2015-10-23T08:51:16Z loke: lisp174: You can do it Lisp too, but you neep to ensure that the DEFUN is evaluated before the DEFMACRO. 2015-10-23T08:51:37Z Shinmera: Defining macros and using them later on in the same file works just fine 2015-10-23T08:51:46Z loke: lisp174: You do that by wrapping the defun in (eval-when (:compile-toplevel :load-toplevel :execute) ...) 2015-10-23T08:51:50Z Shinmera: As long as the functions that the macro uses are already available at the time of macro expansion. 2015-10-23T08:51:56Z johann_ joined #lisp 2015-10-23T08:52:07Z ehu joined #lisp 2015-10-23T08:53:11Z Shinmera: You can also stash the function into a different file and compile&load that one first. 2015-10-23T08:53:13Z larme quit (K-Lined) 2015-10-23T08:53:13Z gko quit (K-Lined) 2015-10-23T08:53:13Z SAL9000 quit (K-Lined) 2015-10-23T08:53:47Z pt1 joined #lisp 2015-10-23T08:53:56Z Shinmera: Depending on how you organise your project one or the other might be the preferred solution. 2015-10-23T08:54:18Z lisp174: I see. In that case, I unfortunately have a racket-specific question: If you have: (define (foo) ...) (define-syntax (xyz ...) ... (foo) ...) (xyz) ... Does foo run at compile-time, or runtime? Sorry for all the ...'s; it's just shorthand for "fill in some code, please" 2015-10-23T08:54:27Z lisp174: I understand that this channel may not be appropriate for that question, though. Sorry. 2015-10-23T08:55:08Z lisp174: Here is a working example: https://github.com/arclanguage/anarki/blob/official/ac.scm 2015-10-23T08:55:19Z jackdaniel: lisp174: most people are familiar here with the common lisp, there there #racket and #scheme channels too though 2015-10-23T08:55:23Z ehu1 quit (Ping timeout: 265 seconds) 2015-10-23T08:55:37Z jackdaniel: you might have more in-depth answers about scheme there 2015-10-23T08:55:44Z lisp174: In that file, the macro xdef is defined. Yet it calls ac-global-name, which is a function defined in that same file. 2015-10-23T08:56:00Z lisp174: Ok. Thanks very much, everyone :) 2015-10-23T08:56:14Z whiteline quit (Ping timeout: 250 seconds) 2015-10-23T08:56:17Z whiteline_ quit (Ping timeout: 256 seconds) 2015-10-23T08:56:30Z johann_ quit (Ping timeout: 255 seconds) 2015-10-23T08:56:33Z Shinmera: This channel is CL exclusively for historical raisins. 2015-10-23T08:56:42Z lisp174: Excellent! I love raisins! 2015-10-23T08:57:12Z lisp174: Thank you for pointing me in the right direction. Have a good evening 2015-10-23T08:57:19Z jackdaniel: \o 2015-10-23T08:58:05Z ryankarason quit (Ping timeout: 250 seconds) 2015-10-23T08:58:24Z loke: Having the nickname lisp174 and then ask questions on Scheme makes me a bit dizzy. 2015-10-23T08:59:05Z lisp174 is now known as commonlisp174 2015-10-23T08:59:10Z commonlisp174: ;) 2015-10-23T08:59:45Z loke: "Lisp" generally means "Common Lisp", so unless you decide to ask CL questions, that doesn't change much. ;-) 2015-10-23T09:01:06Z jackdaniel wonders what historical reasons except "we registered it first" Shinmera has in mind regarding the irc channel 2015-10-23T09:01:24Z loke: jackdaniel: The history of Lisp, I presume. 2015-10-23T09:01:40Z jackdaniel: I feel enlightened now, thanks 2015-10-23T09:01:41Z commonlisp174: Mmhm. I was going for two levels of irony with my joke. Alas 2015-10-23T09:02:22Z loke: Lots of lisps converged and created Common Lisp, which is/was "Lisp". Scheme (and a couple of others) went their own way, and created their own language with a different name, taking lots of inspiration from Lisp. They named it "Scheme". 2015-10-23T09:03:06Z Shinmera: Please let's not start this debate again, it's so tedious. 2015-10-23T09:03:29Z jackdaniel: soo, if I name a cow "dog" then it's all fine, it's a dog. But I agree - sorry for rising this up. 2015-10-23T09:05:49Z snv joined #lisp 2015-10-23T09:07:55Z srcerer quit (Ping timeout: 260 seconds) 2015-10-23T09:08:32Z loke: jackdaniel: Exactly. A cow isn't a dog. Just as scheme isn't Lisp. It's "lisp-like" or "lisp-inspired", just as a dog is like a cow in that it has four legs and a tail. 2015-10-23T09:09:15Z srcerer joined #lisp 2015-10-23T09:09:44Z jackdaniel: scheme isn't common lisp. lisp is a family of the languages 2015-10-23T09:09:59Z Shinmera groans 2015-10-23T09:10:33Z ehu1 joined #lisp 2015-10-23T09:10:35Z loke: jackdaniel: Except it isn't. 2015-10-23T09:10:53Z loke: There is "Lisp-like languages". That's a family. 2015-10-23T09:12:04Z jackdaniel: nope 2015-10-23T09:13:51Z ehu quit (Ping timeout: 256 seconds) 2015-10-23T09:14:02Z remi`bd: loke: Lisp has been in constant evolution since its creation in 1958, dividing itself in many dialects 2015-10-23T09:14:40Z loke: remi`bd: Correct. But the main "Lisp" one has followed a single red line since 1958. 2015-10-23T09:14:55Z ehu1 quit (Ping timeout: 260 seconds) 2015-10-23T09:15:01Z remi`bd: well, could you precise this “red line”? 2015-10-23T09:15:02Z loke: There have been deviations, and in the 80's these were mostly reigned in when CL was created. 2015-10-23T09:15:19Z remi`bd: why CL and not Scheme? 2015-10-23T09:15:36Z loke: Because scheme has no interest of being part of "Lisp". THat's why it was created in the first place. 2015-10-23T09:15:56Z xificurC joined #lisp 2015-10-23T09:16:19Z loke: Scheme was created as a reaction _against_ the rest of the Lisp evolution (which eventually became CL) 2015-10-23T09:16:37Z loke: That's why it's called "Scheme" and not "Slisp" or "SchemeLisp" 2015-10-23T09:16:53Z remi`bd: yes, but one might say Scheme is closer to the original Lisp than CL is 2015-10-23T09:18:35Z xificurC_ quit (Ping timeout: 265 seconds)