00:06 (quit) Demosthenex: Ping timeout: 250 seconds 00:08 (join) RacketCommitBot 00:08 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/x_Vwtg 00:08 RacketCommitBot: racket/master bc5e811 Matthew Flatt: dist-spec fix... 00:08 (part) RacketCommitBot 00:21 (join) Demosthenex 00:27 (quit) Demosthenex: Remote host closed the connection 00:27 (quit) mithos28: Quit: mithos28 00:28 (join) Demosthenex 00:29 (join) mithos28 00:30 lewis1711: (struct internal (parent slots [depth #:auto]) 00:30 lewis1711: #:auto-value (add1 [parent '_depth]) ... 00:30 lewis1711: getting an error because "parent" is unbound here. what would be away around this? 00:31 mithos28: auto values are the same for all structure values of a given structure type 00:31 mithos28: I don't think they are what you want 00:31 mithos28: you probably want a smart constructor 00:31 lewis1711: ah 00:31 mithos28: just write a function internal* which calculates depth for you 00:31 mithos28: and then on export rename it 00:32 lewis1711: that seems like a sane solution. thanks 00:34 (quit) Demosthenex: Ping timeout: 252 seconds 00:36 (join) Demosthenex 00:44 (join) sw2wolf 00:59 (join) mizu_no_oto 01:13 (quit) jonrafkind: Ping timeout: 252 seconds 01:19 mithos28: is there a way to make xrepl not hide the backtrace of error messages 01:42 (join) jonrafkind 01:45 (quit) jeapostrophe: Read error: Operation timed out 02:02 lewis1711: is there a way to bind a symbol with a define? 02:02 mithos28: what do you mean by that? 02:02 lewis1711: given 'a, give me an object a equal to 3 02:03 mithos28: eval? 02:03 mithos28: eval is usually not a good answer though 02:04 lewis1711: some macro that takes 'a 02:04 lewis1711: and gives me (define a 3) 02:04 lewis1711: or does that, with a begin form maybe 02:04 mithos28: rudybot: (define-syntax-rule (f x) (define x 3)) 02:04 rudybot: mithos28: Done. 02:04 mithos28: rudybot: (f y) 02:04 rudybot: mithos28: Done. 02:04 mithos28: rudybot: y 02:04 rudybot: mithos28: ; Value: 3 02:05 mithos28: is that what you want? 02:05 lewis1711: that wouldn't work with 'y 02:06 lewis1711: what is the type of y? that's probably where I am getting confused 02:07 mithos28: rudybot: (define-syntax (g stx) (syntax-case stx (quote) ((_ 'x) (define x 3)))) 02:07 rudybot: mithos28: error: begin (possibly implicit): no expression after a sequence of internal definitions in: ((define x 3)) 02:07 mithos28: rudybot: (define-syntax (g stx) (syntax-case stx (quote) ((_ 'x) #'(define x 3)))) 02:07 rudybot: mithos28: Done. 02:07 mithos28: rudybot: (g 'a) 02:07 rudybot: mithos28: Done. 02:07 mithos28: a 02:07 mithos28: rudybot: a 02:07 rudybot: mithos28: ; Value: 3 02:07 mithos28: Is that what you want 02:08 lewis1711: yes! alright that's a tiny enough macro that I should figure out the nuts and bolts of it 02:08 mithos28: so 'y is read as (quote y) 02:09 mithos28: the second part of syntax-case says which words are literals 02:09 mithos28: ie quote is used for matching against specificly an identfier with the binding of quote 02:10 mithos28: rudybot: (g (quote b)) 02:10 rudybot: mithos28: Done. 02:10 mithos28: rudybot: b 02:10 rudybot: mithos28: ; Value: 3 02:11 lewis1711: so... y is the syntax 02:11 lewis1711: and (quote) tells syntax case that it's coming in quoted form? 02:11 mithos28: no 02:11 mithos28: quote is not magic at all 02:12 mithos28: rudybot: (define-syntax (h stx) (syntax-case stx (list) ((_ (list x)) #'(define x 3)))) 02:12 rudybot: mithos28: Done. 02:12 mithos28: rudybot: (h (list q)) 02:12 rudybot: mithos28: Done. 02:12 sw2wolf: What's corresponding of #'multi-value-bind in racket ? 02:12 mithos28: rudybot: q 02:12 rudybot: mithos28: ; Value: 3 02:12 mithos28: sw2wolf: I don't know common lisp. Can you explain what that does? 02:13 sw2wolf: bind multiple value 02:14 mithos28: rudybot: (let-values (((a b) (values 1 2))) (+ a b)) 02:14 rudybot: mithos28: ; Value: 3 02:14 mithos28: rudybot: (define-values (x y) (values 3 4)) 02:14 rudybot: mithos28: Done. 02:14 mithos28: rudybot: (+ x y) 02:14 rudybot: mithos28: ; Value: 7 02:14 lewis1711: rudybot: (define-syntax (g stx) (syntax-case stx (quote list) [(_ 'x) #'(define x 3)] ((_ (list x)) #'(define x 4)))) 02:14 rudybot: lewis1711: your sandbox is ready 02:14 rudybot: lewis1711: Done. 02:14 lewis1711: rudybot: (g (list lol)) 02:14 rudybot: lewis1711: Done. 02:14 lewis1711: rudybot: lol 02:14 rudybot: lewis1711: ; Value: 4 02:15 lewis1711: hm 02:15 (quit) dnolen: Quit: ERC Version 5.3 (IRC client for Emacs) 02:15 mithos28: sw2wolf: Is that what you wanted? 02:16 sw2wolf: (multiple-value-bind (x y) (xlib:query-pointer (window-xwin win)) ...) 02:16 sw2wolf: i want to translate it into racket code ? 02:16 mithos28: i had two examples with let-values and define-values 02:17 sw2wolf: yes 02:17 sw2wolf: mind show me ? 02:18 mithos28: I sent them to rudybot a minute ago, did you miss that? 02:18 sw2wolf: i just come back 02:18 mithos28: rudybot: (let-values (((a b) (values 1 2))) (+ a b)) 02:18 rudybot: mithos28: ; Value: 3 02:19 mithos28: rudybot: (define-values (x y) (values 3 4)) 02:19 rudybot: mithos28: Done. 02:19 mithos28: rudybot: (+ x y) 02:19 rudybot: mithos28: ; Value: 7 02:19 sw2wolf: let-values will be my choice, thx 02:27 (quit) jonrafkind: Ping timeout: 265 seconds 02:29 lewis1711: rudybot: (define-syntax (g do-nothing stx) (syntax-case stx (quote list) [(_ 'x) #'(define x 3)] [(_ (list x)) #'(define x 3)])) 02:29 rudybot: lewis1711: Done. 02:29 lewis1711: rudybot: (g null 'a) 02:29 rudybot: lewis1711: error: #:1:0: g: illegal use of syntax in: (g null (quote a)) 02:30 lewis1711: rudybot: (g a 'a) 02:30 rudybot: lewis1711: error: #:1:0: g: illegal use of syntax in: (g a (quote a)) 02:30 mithos28: lewis1711: thats not going to work 02:30 mithos28: you want g to only have one argument 02:31 mithos28: if you call g as (g null 'a), stx is bound to the syntax object #'(g null 'a) 02:31 mithos28: the (_ 'x) part destructures it 02:31 mithos28: the underscore matches the macro part because you usually don't care about it 02:32 lewis1711: hmm 02:32 mithos28: so if you want a macro that takes two arguments change that to (_ x y) 02:32 mithos28: where x and y are any patterns you want 02:32 lewis1711: but syntax-case only takes "stx" as an argument 02:32 lewis1711: so how does it even 'know' about do-nothing? 02:32 mithos28: it doesn't even get that far 02:32 mithos28: for a macro to work it needs to take one argument 02:33 mithos28: which is the whole form 02:33 lewis1711: rudybot: (define-syntax (g val stx) (syntax-case stx (quote) [(_ 'x t) #'(define x t)])) 02:33 rudybot: lewis1711: Done. 02:34 lewis1711: (g 'a 3) 02:34 lewis1711: rudybot: (g 'a 3) 02:34 rudybot: lewis1711: error: #:1:0: g: illegal use of syntax in: (g (quote a) 3) 02:34 mithos28: get rid of the val 02:34 (join) asvil 02:34 lewis1711: rudybot: (define-syntax (g stx) (syntax-case stx (quote) [(_ 'x t) #'(define x t)])) 02:34 rudybot: lewis1711: Done. 02:34 lewis1711: (g 'a 3) 02:34 lewis1711: rudybot: (g 'a 3) 02:34 rudybot: lewis1711: Done. 02:34 lewis1711: rudybot: a 02:34 rudybot: lewis1711: ; Value: 3 02:35 (quit) Demosthenex: Ping timeout: 250 seconds 02:35 lewis1711: so macros of the form "define-syntax" always take one argument? which is the whole form? 02:36 mithos28: all macros are of the form define-syntax, all other macros expand out to them 02:36 mithos28: *macros -> macro definitions 02:36 mithos28: and yes they always take the whole form 02:37 (join) Demosthenex 02:38 lewis1711: I see 02:46 (join) cdidd 02:59 (quit) Demosthenex: Ping timeout: 255 seconds 02:59 (quit) mizu_no_oto: Quit: ["Textual IRC Client: www.textualapp.com"] 03:00 (join) Demosthenex 03:01 (quit) ambrosebs: Ping timeout: 246 seconds 03:04 (quit) veer: Quit: Leaving 03:05 (join) RacketCommitBot 03:05 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/Py2lZg 03:05 RacketCommitBot: racket/master 777a6cd Eli Barzilay: New Racket version 5.3.1.9. 03:05 (part) RacketCommitBot 03:08 (quit) Demosthenex: Ping timeout: 244 seconds 03:11 (quit) tsion: Quit: Leaving 03:15 (join) ambrosebs 03:17 (join) Demosthenex 03:22 (join) momo-reina 03:28 (quit) nilyaK: Quit: Leaving. 03:33 (quit) momo-reina: Remote host closed the connection 03:45 (quit) Nisstyre-laptop: Read error: Operation timed out 03:59 (part) sw2wolf: "ERC Version 5.3 (IRC client for Emacs)" 04:10 (join) neilv 04:24 (join) bitonic 04:33 (quit) Demosthenex: Ping timeout: 252 seconds 04:35 (join) Demosthenex 04:54 (quit) Demosthenex: Read error: Operation timed out 04:58 (join) Demosthenex 05:04 (quit) mithos28: Quit: mithos28 05:04 (quit) Demosthenex: Ping timeout: 264 seconds 05:06 (join) Demosthenex 05:16 (quit) ambrosebs: Ping timeout: 264 seconds 05:18 neilv: (canonicalize-path "y/b1/s") ;==> # 05:20 (quit) Demosthenex: Ping timeout: 245 seconds 05:28 (join) Demosthenex 05:42 (join) MayDaniel 05:44 (quit) bitonic: Ping timeout: 240 seconds 05:49 (join) soegaard 05:50 lewis1711: woo, I have coded basic prototype objects. they're pretty ugly to use though 05:52 neilv: cool 05:53 neilv: i made a simple prototype object library in scheme a while ago. http://www.neilvandyke.org/protobj/ 05:57 lewis1711: neilv: nice. did you use hashtables internally? 05:58 lewis1711: much better looking than mine lol 06:01 (join) bitonic 06:03 neilv: i used old scheme that didn't have hash tables 06:04 lewis1711: ah I see. racket 5.3 is kicking up a bit of fuss installing it :) 06:07 neilv: this is strange. drracket is trying to install neil/parted when i require neil/protobj 06:08 lewis1711: hmm still seems to work a treat 06:09 neilv: looks like i just had an aborted planet install, although i don't recall that 06:10 neilv: btw, i would not use mutable pairs nowadays 06:12 neilv: but you might look at using assq rather than hash-ref, and whether that's faster when you don't have that many slots. and/or do optimizations of slot lookup, such as at compile time 06:13 lewis1711: I will indeed 06:14 lewis1711: do you have any tips on coding "self"? mine is sort of stupid in that I can't send messages to self in any of the methods, just to an instance of an object, which of course remains fixed when its cloned 06:15 neilv: you can make self be an express argument to each method closure 06:16 lewis1711:   (! a xplus (lambda ($ n) (+ (? $ x) n))) 06:16 lewis1711: ohhh of course I see what you've done 06:16 neilv: if you want to have self be more magical, you could to it with syntax extension (there is a feature to make macros for identifiers that are not surrounded by parens), or you could make it a parameter (in the sense of make-parameter) 06:16 lewis1711: @ just passes in the object into the $ position 06:17 neilv: oh yeah, i guess $ was short for $elf 06:21 lewis1711: I tried to copy how lua did it 06:22 (join) sw2wolf 06:39 lewis1711: (define-syntax-rule (method args body ...) 06:39 lewis1711: (lambda args body ...)) 06:40 lewis1711: if I wanted to append or cons "self" onto the arguments list, how would I do it? In the context of define-syntax-rule, what type is args? 06:40 (quit) Demosthenex: Read error: Operation timed out 06:43 (join) Demosthenex 06:45 neilv: args is a list 06:46 (join) masm 06:48 sw2wolf: it is a list 06:48 lewis1711: rudybot: (define-syntax-rule (method args body ...) (lambda (cons self args) body ...)) 06:48 rudybot: lewis1711: Done. 06:48 lewis1711: rudybot: (method (x) x) 06:48 rudybot: lewis1711: error: #:1:8: lambda: not an identifier, identifier with default, or keyword at: (x) in: (lambda (cons self (x)) x) 06:49 lewis1711: oh 06:53 lewis1711: ok how would I do this? I mean I sort of get why its done that. it's just shuffling around tokens, it's not actually doing anything to them 07:05 (quit) sw2wolf: Quit: Leaving 07:19 (join) mye 07:28 (join) RacketCommitBot 07:28 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/wzbnKQ 07:28 RacketCommitBot: racket/master 19d7519 Matthew Flatt: don't fail when there's no user-specific docindex 07:28 (part) RacketCommitBot 07:30 lewis1711: http://pastebin.com/Nq1701UK I got this far. self isn't in the context.. hmm 07:37 neilv: the problem you're running into is called "hygiene" 07:37 neilv: or, rather, you're running into the soap 07:38 lewis1711: I see 07:39 lewis1711: so I should write a common lisp type macro? 07:39 neilv: introducing "self" as a variable like that is intentionally made difficult 07:39 neilv: http://doc.racket-lang.org/guide/pattern-macros.html#%28part._.Identifier_.Macros%29 07:39 rudybot: http://tinyurl.com/blwlxbt 07:39 neilv: this is one way that might work 07:40 neilv: it's an advanced thing in macros. you almost never want to do things that way. but in the case of "self", you could make a good argument for it 07:46 lewis1711: (syntax-id-rules () 07:46 lewis1711: [(_ () body) (lambda (self) body)] 07:46 lewis1711: [(_ (args ...) body) (lambda (self args ...) body)])) 07:46 lewis1711: I am not sure if syntax-id-rules needs an argument 07:48 (quit) bitonic: Ping timeout: 240 seconds 07:50 (quit) mye: Quit: mye 07:58 (join) mye 08:02 (join) RacketCommitBot 08:02 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/2vCcHA 08:02 RacketCommitBot: racket/master 7ef4bec Jens Axel Søgaard: Added more margin notes 08:02 (part) RacketCommitBot 08:04 (quit) neilv: Quit: Leaving 08:25 (join) jeapostrophe 08:25 (quit) jeapostrophe: Changing host 08:25 (join) jeapostrophe 08:37 (quit) bjz: Quit: Leaving... 09:00 (join) karswell 09:07 (part) lewis1711 09:08 (quit) mye: Quit: mye 09:09 (join) RacketCommitBot 09:09 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/a1Lp5Q 09:09 RacketCommitBot: racket/master 124b5ab Mike Sperber: Synch German string constants with latest. 09:09 (part) RacketCommitBot 09:09 (join) em 09:18 (join) anRch 09:38 (quit) jschuster: Quit: Coyote finally caught me 09:42 (quit) soegaard: Quit: soegaard 09:53 (join) ambrosebs 10:06 (join) dnolen 10:10 (join) soegaard 10:14 (quit) anRch: Quit: anRch 10:16 (join) RacketCommitBot 10:16 RacketCommitBot: [racket] plt pushed 4 new commits to master: http://git.io/4HlwNA 10:16 RacketCommitBot: racket/master c12a129 Matthew Flatt: remove unused locking layer in the doc database manager 10:16 RacketCommitBot: racket/master 3f08da6 Matthew Flatt: remove 'always-run style from the doc that list documents... 10:16 RacketCommitBot: racket/master 4ca6e3c Matthew Flatt: fix exception handling during collection-table read... 10:16 (part) RacketCommitBot 11:00 (quit) MayDaniel: Read error: Connection reset by peer 11:22 (join) RacketCommitBot 11:22 RacketCommitBot: [racket] plt pushed 7 new commits to master: http://git.io/0BepcA 11:22 RacketCommitBot: racket/master ecb88af Jay McCarthy: Fixing some ugly line-widths in DrDr 11:22 RacketCommitBot: racket/master fd86928 Jay McCarthy: Changing the timeout for this file for DrDr... 11:22 RacketCommitBot: racket/master cf7e54b Jay McCarthy: Set a maximum timeout for all tests in DrDr 11:22 (part) RacketCommitBot 11:29 ambrosebs: I've been thinking about this problem for a while. 11:29 ambrosebs: How do runtime contracts generated for Typed Racket interact with parametric polymorphism? 11:31 ambrosebs: It seems like we could add runtime casts at any point in a Typed Racket but it's not always clear what to test for with type variables in the types. 11:31 ambrosebs: I'm being vague because I guess I don't really know if it's a problem. 11:32 ambrosebs: haha please call me out if I'm not being clear enough. 11:40 (quit) walter: Ping timeout: 265 seconds 11:40 (join) walter|r 12:00 (quit) karswell: Ping timeout: 265 seconds 12:22 (join) MayDaniel 12:25 (quit) Shviller: Read error: Connection reset by peer 12:30 (join) Shviller 12:33 (join) torog 12:34 torog: if, cond etc. are evaluated lazily in racket, aren't they? 12:41 soegaard: What do you mean by lazily? 12:45 (join) mithos28 12:51 (join) muraiki 12:52 muraiki: Hi all! In Racket, what would be the idiomatic way to traverse a hash? For instance, I have a hash that maps names to structs and I want to call some functions to use the data in the structs (but not modify the hash). In Python I'd use a list comprehension, but I'm not quite sure what to do in Racket. 12:53 muraiki: I thought about using the hash-iterate functions in a recursive function but I feel like there's probably a more straightforward way to do it. 12:54 mithos28: rudybot: (for (((key value) (hash 'a 1 'b 2))) (printf "Key ~a, value ~a" key value)) 12:54 rudybot: mithos28: i guess i don't see what makes a simple printf falsely lazy 12:54 muraiki: oh, it looks like I might have stumbled in on a relevant discussion 12:54 mithos28: muraiki: That should have done it 12:54 muraiki: haha 12:54 mithos28: but I think I messed up a paren 12:55 mithos28: rudybot: eval (for (((key value) (hash 'a 1 'b 2))) (printf "Key ~a, value ~a" key value)) 12:55 rudybot: mithos28: ; stdout: "Key b, value 2Key a, value 1" 12:56 muraiki: Thanks! 12:56 mithos28: hash iterate is way too low level, many things like for comprehensions are built on top of it 12:57 muraiki: Yeah, I felt like there would be a higher level function for it. I'll look up how for works. 12:58 (join) Nisstyre-laptop 13:02 (join) mizu_no_oto 13:07 (quit) masm: Quit: Leaving. 13:09 (quit) torog: Quit: leaving 13:20 (join) mye 13:25 offby1: any of the "for" forms will traverse a hash 13:29 (quit) Demosthenex: Quit: leaving 13:30 (join) Demosthenex 13:30 (quit) ambrosebs: Ping timeout: 240 seconds 13:35 (join) RacketCommitBot 13:35 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/wH6Pdg 13:35 RacketCommitBot: racket/master 4b094f8 Matthew Flatt: raco setup: fix for non-parallel doc build in a fresh installation 13:35 (part) RacketCommitBot 13:54 (join) myx 13:55 (quit) Nisstyre-laptop: Quit: Leaving 13:57 (join) Nisstyre-laptop 14:32 (quit) mye: Quit: mye 14:40 (quit) mithos28: Quit: mithos28 14:43 (join) mye 14:50 (quit) snorble_: Ping timeout: 240 seconds 14:53 (join) mye_ 14:53 (join) bitonic 14:57 (quit) mye: Ping timeout: 252 seconds 14:57 (nick) mye_ -> mye 15:02 (quit) mizu_no_oto: Quit: ["Textual IRC Client: www.textualapp.com"] 15:06 (join) RacketCommitBot 15:06 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/VGxaIg 15:06 RacketCommitBot: racket/master 793ee71 Robby Findler: fix a coloring bug... 15:06 (part) RacketCommitBot 15:06 (quit) jrslepak: Quit: What happened to Systems A through E? 15:11 mye: If I want to write what a macro returns to an output port, what do I do? (except, obviously, come here and ask :-) 15:11 mye: I suppose it will involve manipulating phases or something 15:12 mye: (I'm generating (trying anyway) ffi bindings from a json input file and want to write the bindings as a single file) 15:13 mye: now I'm doing all the macros that create the ffi syntax, but I'm not sure how to create the file 15:17 (join) mithos28 15:19 (quit) muraiki: Quit: Leaving 15:23 mye: does the macro stepper only do phase 1 ? :( 15:24 (quit) Nisstyre-laptop: Ping timeout: 244 seconds 15:30 soegaard: mye: In the body of the macro use: (let () (define out ) (display out) (newline) out) 15:31 soegaard: This will print out the expansion every time the macro is used. 15:31 soegaard: Then in DrRacket click the small triangles to fold out the syntax object printed. 15:37 mye: soegaard: yeah that's a good way to do it thanks. (I was changing the macros to return strings to write that) 15:42 (join) snorble_ 15:42 (join) Nisstyre-laptop 16:05 (join) jschuster 16:22 (join) nathanpc 16:36 (join) jonrafkind 16:37 (join) RacketCommitBot 16:37 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/kmrM_A 16:37 RacketCommitBot: racket/master dd9d85f Eli Barzilay: Cleanup junk files in a bunch of racket tests. 16:37 (part) RacketCommitBot 17:12 (quit) mithos28: Quit: mithos28 17:16 (quit) jschuster: Quit: Coyote finally caught me 17:34 (join) anRch 17:44 (join) walter|rtn 17:47 (quit) walter|r: Ping timeout: 256 seconds 17:51 (join) jschuster 17:53 (join) mithos28 18:18 (join) bjz 18:26 mithos28: can planet 2 packages run code on installation? 18:37 soegaard: yes. Planet 1 can too. 18:37 mithos28: is there documentation on how to do it for planet 2? 18:37 soegaard: Unless I have misunderstood something. 18:38 soegaard: Well, when you require a module, code runs. 18:38 mithos28: thats at runtime 18:39 mithos28: I want code that runs once per installation, it is compiling a c++ file into a dynamic library 18:39 soegaard: Well, (begin-for-syntax …) will make it run at compile time. 18:39 mithos28: thats not installation time 18:39 soegaard: Just check whetner the resulting file is present, and compile only of it is missing. 18:40 mithos28: So it seems like the answer is no then, but I can hack it as you suggest 18:42 soegaard: I guess it depends on the point of view whether it is a hack or not :-) 18:44 mithos28: It will work, but I wish there was a more principled way 18:47 (join) francisl 18:49 (quit) cdidd: Remote host closed the connection 18:56 (quit) MayDaniel: Read error: Connection reset by peer 18:57 (quit) mithos28: Quit: mithos28 18:57 (quit) anRch: Quit: anRch 19:01 (join) mithos28 19:10 (quit) mithos28: Quit: mithos28 19:12 (quit) Demosthenex: Ping timeout: 240 seconds 19:14 (join) Demosthenex 19:22 (quit) francisl: Quit: francisl 19:32 (quit) bitonic: Ping timeout: 260 seconds 19:43 (join) tsion 19:43 (quit) tsion: Changing host 19:43 (join) tsion 19:51 (quit) jonrafkind: Ping timeout: 246 seconds 19:58 (quit) jeapostrophe: Ping timeout: 265 seconds 20:03 (join) mizu_no_oto 20:03 (join) aezx 20:05 (join) mithos28 20:07 (join) lewis1711 20:10 aezx: i just tried sublime for the second time and I'm switching to it. it has paredit now, and it's gorgeous 20:11 lewis1711: what's that? a text editor? 20:13 aezx: yeah 20:13 aezx: sublime text 2 20:13 aezx: very graphical 20:13 aezx: old school lispers seem to dislike it 20:13 (join) jonrafkind 20:13 aezx: "emacs!!!!11!!!one!!!!" 20:14 aezx: emacs gives you arthritis after half an hour, no thanks 20:15 lewis1711: LOL 20:15 jonrafkind: what does vi give you? 20:15 lewis1711: yeah one of the reasons I avoid common lisp is that if you try and use anything without emacs you are out of luck 20:15 aezx: vi is great 20:16 aezx: i dont have to use weird multi key combos 20:16 aezx: i can type commands 20:16 lewis1711: emacs is probably the worlds best editor but I can't figure it all out. and I spent days and days on it. of course some people here may know I'm not the sharpest tool in the shed but still, vim is plenty complex enough for me 20:16 aezx: eh 20:17 aezx: i can make do with whatever i have to 20:17 offby1: lewis1711: #emacs for occasional actual useful help, and constant off-topic randomness :) 20:17 offby1: aezx: if I didn't have Emacs, it'd be like someone cut off both my arms. 20:17 aezx: i dont like arguing about text editors. if people have time to argue about personal preference, they aren't coding enough 20:17 aezx: offby1, do hand stretches a lot or you will get arthritis for real 20:18 offby1: aezx: I've been using it for almost 30 years; no hint of arthritis. 20:18 aezx: cyborg detected 20:18 offby1: I do insist on "Microsoft Natural"-style keyboards for desktops, though. 20:19 jonrafkind: real hackers use ibm model M 20:19 aezx: i like those keyboards that are slightly curved, it feels more natural because I have huge hands 20:19 aezx: real hackers arent defining themselves through keyboards and editors 20:20 jonrafkind: are you sure? 20:21 aezx: 100% 20:22 aezx: that being said, it's futile to deny that Model M was the rosetta stone of keyboards 20:22 aezx: we've studied and studied it, but it's true power remains locked 20:23 aezx: aliens 20:26 (join) eMBee 20:27 (quit) mizu_no_oto: Quit: Computer has gone to sleep. 20:28 offby1: oh, the true power is well-understood: it's the clackety-clackety sound. 20:28 offby1: That sounds summons up the hacker daemons. 20:28 offby1: Also the ghosts of typists past. 20:29 lewis1711: I have hands like a little girl. maybe that's why I don't mind netbook keyboards 20:43 aezx: i love the way scheme teaches me simplicity through exemplifying my own stupidity 20:43 aezx: the best teacher is truly oneself 20:45 (join) mizu_no_oto 21:10 (quit) mithos28: Quit: mithos28 21:16 offby1: I wish :-| 21:27 lewis1711: oh yeah, I should ask my syntax-id-rules question again 21:28 (join) mithos28 21:28 offby1: oh yeah. 21:28 lewis1711: http://pastebin.com/kkCG0DYX how can I capture self in this? 21:29 jonrafkind: you need to syntax-local-introduce it 21:29 jonrafkind: or create the self syntax using the lexical context of body 21:29 jonrafkind: i think both things you cannot do in syntax-id-rules 21:29 jonrafkind: you probably have to do 'make-set!-transformer' yourself 21:29 jonrafkind: so you can use syntax-case 21:30 lewis1711: I had a syntax-case version before, but make-set!-transformer is new to me 21:31 lewis1711: why do I need something that cooperates with set! ? 21:31 lewis1711: http://docs.racket-lang.org/reference/syntax-model.html#%28tech._assignment._transformer%29 21:31 rudybot: http://tinyurl.com/crozwrh 21:32 jonrafkind: i dunno why were you using syntax-id-rules in the first place? 21:32 jonrafkind: i almost never use set! transformers 21:32 lewis1711: jonrafkind: someone else here suggested it because appareantly the issue was I was running into variable capture hygiene problems 21:33 lewis1711: because the self i write in method becomes different to the self inside the macro 21:33 jonrafkind: variable capture is orthogonal to set! transformers 21:33 jonrafkind: you just need to get the right lexical context 21:34 jonrafkind: so either do (with-syntax ([self (datum->syntax #'body 'self #'body)]) #'(lambda (self blah...) body)) 21:34 jonrafkind: or something with syntax-local-introduce that i would have to read the docs to figure out 21:35 (join) sw2wolf 21:36 lewis1711: i will look at with-syntax 21:37 jonrafkind: the deal with syntax-local-introduce is it adds a mark for the current macro transform so it will end up not being alpha renamed 21:37 lewis1711: ok these docs make no sense to me 21:38 jonrafkind: all the syntax passed to the macro is marked with a mark like A on input and then remarked with A on output, so two marks cancel 21:39 lewis1711: thanks, but I don't understand any of your explinations :) I think I need to do a macro tutorial or something, it doesn't seem to be something you can learn by doing 21:40 jonrafkind: http://www.cs.indiana.edu/~dyb/pubs/bc-syntax-case.pdf 21:40 jonrafkind: this explains marking 21:41 offby1: hm, my cat marks occasionally. 21:41 offby1: I wish he wouldn't. 21:43 lewis1711: oh so even offby1s cat is a better scheme programmer than me ;) 21:43 lewis1711: what is a binding, exactly? 21:44 lewis1711: "The transformation above works fine in most cases, but it breaks down if the identifier t appears free in e2 (i.e., outside of any binding for t in e2)," 21:46 offby1: it's what "lambda" creates for the parameters. 21:46 offby1: A region of your code where a variable is ... uh ... bound. 21:47 jonrafkind: a binding is a mapping between an identifier and a location in the environment basically 21:47 jonrafkind: to look up an identifier in the environment you use its name, like its actual symbol value, and its "lexical context' 21:47 jonrafkind: lexical context is an opaque thing, you can't really print it 21:48 jonrafkind: you can think of it as just a simple number though 21:48 jonrafkind: (lambda (x) (lambda (x) x)) 21:48 jonrafkind: the first x in the lambda has lexical context 1, and the second has lexical context 2 21:48 jonrafkind: so both have the same symbol 'x, but different lexical contexts 21:48 lewis1711: so it sort of represents its "distance" from the top level? 21:49 jonrafkind: well i think thats putting too much meaning into what the number is 21:49 jonrafkind: i just chose numbers because they are a simple thing 21:49 lewis1711: fair enough 21:49 jonrafkind: i could have chosen strings, like "a" for the first x and "b" for the second 21:50 jonrafkind: so when dealing with macros you have to be aware of a) lexical context and b) marks on syntax 21:50 sw2wolf: what's "marks on syntax' ? 21:50 jonrafkind: although I think the lexical context incorporates marks so its kind of the same thing 21:51 jonrafkind: when you invoke a macro the syntax object passed to the macro is "marked" so that its differentiated from syntax built inside the macro 21:51 lewis1711: is a generated identifier like "gensym" ? 21:51 jonrafkind: gensym generates symbols that are not interned 21:51 lewis1711: jonrafkind: I thought only some macros took in syntax objects 21:51 jonrafkind: all macros take in syntax objects 21:51 lewis1711: others took in lists, like define-syntax-rule 21:52 jonrafkind: define-syntax-rule is hiding the true macro api from you 21:52 jonrafkind: so its easier to use 21:52 jonrafkind: define-syntax-rule is a macro that is implemented in terms of define-syntax and syntax-case or something 21:52 lewis1711: hmm 21:52 lewis1711: maybe i should just use define-syntax macros until I understand what's going on 21:53 jonrafkind: as soon as you try to do unhygienic things life becomes very hard 21:53 lewis1711: variable capture? like my "self" attempt? 21:54 jonrafkind: yea 21:55 lewis1711: I see 21:55 lewis1711: aren't there old style common lisp macros when you need to do what I'm doing? 21:56 lewis1711: IIRC CL ones don't have hygience, they just capture variables any old way, and you use gensym when you want to avoid it 21:56 jonrafkind: no in lisp there is no such idea as lexical context. macros in lisp are just unhyienic so when you want to capturer 'self' you just bind it 21:56 jonrafkind: i dont use lisp much but i guess there are people in the lisp community who think hygiene isn't really necessary 22:00 (quit) myx: Ping timeout: 265 seconds 22:13 (join) jeapostrophe 22:13 (quit) jeapostrophe: Changing host 22:13 (join) jeapostrophe 22:16 offby1: jonrafkind: when you say "lisp", do you mean Common Lisp? 22:16 jonrafkind: i dunno i guess 22:16 jonrafkind: are there any lisps that do hygiene? 22:16 offby1: well, Scheme :) 22:17 jonrafkind: gimme a break 22:17 offby1: dunno if Clojure does 22:17 jonrafkind: i think clojure is hygienic 22:18 lewis1711: I use LISP when talking about the family and cl/scheme/clojure/racket. 22:18 jonrafkind: what about racket without s-expressions? would yous till call it a lisp? 22:19 lewis1711: hmm. i guess not 22:19 jonrafkind: i guess s-expression is not a trivial thing but its not really enough to bind those things together with the same language family name 22:20 lewis1711: I can't use cl after getting slightly used to racket. which is a shame is CL has far more resources docs/etc 22:20 lewis1711: yeah, perhaps not 22:20 jonrafkind: https://github.com/kazzmir/Honu/blob/master/asteroids/asteroids.honu i mean this is racket but with non-s-expression syntax (and a different macro system) 22:20 lewis1711: but I mean they're all dynamically typed and have macros and eval and such.. 22:20 jonrafkind: so what about python 22:20 jonrafkind: if it had macros it would be a lisp? 22:20 lewis1711: needs macros and s-expressions 22:20 lewis1711: or something :/ 22:20 jonrafkind: what about just macros? 22:20 lewis1711: nah then C would be a lisp :D 22:21 jonrafkind: C macros aren't even comparable :p 22:21 lewis1711: they're the only ones I know :( 22:22 sw2wolf: i feel it seems CL macro simpler than racket's ? 22:22 lewis1711: speaking of macros - when declaring a new struct you do (struct whatever (field-1 field-2)) - does this break hygiene? since it captures "whatever", "field-1" and "field-2" 22:22 jonrafkind: sw2wolf, yes because it doesnt have hygiene 22:22 jonrafkind: so you are just manipulating lists which is pretty easy 22:23 sw2wolf: sorry ! i donot understand why we need hygiene macro ? 22:23 lewis1711: woah, honu looks like javascript 22:23 jonrafkind: to prevent unwanted variable capture 22:23 sw2wolf: unhygien seems work well in CL ? 22:24 jonrafkind: i assume you mean gensym. i dont remember offhand common situations where it doesn't work, but anyway its easy to write a broken macro if you mis-use/dont use genym 22:24 sw2wolf: would you mind showing me a example if hygiene usage ? 22:24 offby1: jonrafkind: don't we have a bot with factoids or something? I'd think this is a prime candidate for a channel FAQ 22:25 offby1: _once_ I read an article about hygienic macros that I almost understood. It might have been by Shriram or Matthew 22:25 jonrafkind: (define-syntax-rule (or a b) (let ([t a]) (if t t b))) (let ([t 2]) (or #f t)) will be #f instead of 2 22:25 offby1: can't find it now though 22:29 lewis1711: can anyone show me an example of syntax-local-introduce? 22:29 lewis1711: a really basic one 22:30 (join) Kaylin 22:30 jonrafkind: hm you might just be able to do (with-syntax ([self (syntax-local-introduce (datum->syntax #f 'self))]) ...) 22:33 lewis1711: what does that look like in the context of define-syntax ? 22:33 jonrafkind: sw2wolf, http://www.ccs.neu.edu/racket/pubs/dissertation-kohlbecker.pdf kohlbeckers dissertation will hopefully answer some questions about hygiene and why its needed 22:33 offby1: "if", I'd like you to meet "lambda". 22:33 jonrafkind: (define-syntax (foo stx) (syntax-case stx [(whatever) (with-syntax ...)])) 22:33 (quit) Shviller: Ping timeout: 240 seconds 22:33 (join) Shviller 22:34 Kaylin introduces if to cond first. 22:34 sw2wolf: (defmacro or (a b) `(let ((t ,a)) (if t t ,b))) 22:34 sw2wolf: (let ((t 2)) (or nil t)) will report error 22:34 sw2wolf: so CL needs gensym 22:35 jonrafkind: you asked for an example, not a particularly great one 22:35 jonrafkind: i know you can use gensym 22:35 jonrafkind: the point is for very complicated macros its easy to mess things up with gensym 22:35 sw2wolf: yes 22:35 jonrafkind: in a hygienic macro system you have to try very hard to mess things up 22:38 sw2wolf: doesnot racket macro need gensym ? 22:38 jonrafkind: you only need gensym as a way to generate new unique identifiers, but even then its just a convenience, not really necessary 22:39 jonrafkind: you don't need to do anything special to prevent identifiers created in the macro (like that 't') from conflicting with identifiers outside the macro 22:39 jonrafkind: hygiene will do it for you 22:40 sw2wolf: so in (let ([t a]) ... ) , then binding doesnot occur ? 22:40 jonrafkind: binding does occur, but hygiene will alpha rename that 't' so it does not conflict with the users t 22:41 sw2wolf: alpha rename seems like gensym ? 22:41 jonrafkind: yes but its automatic 22:41 jonrafkind: gensym is manual 22:41 sw2wolf: oh, i see now. thx 22:41 jonrafkind: k 22:41 lewis1711: is this stuff supposed to be very hard to learn or am i doing it wrong? :/ 22:41 jonrafkind: its not the easiest thing.. 22:42 offby1: we deliberately made it hard to keep people like you from penetrating the inner sanctum 22:44 lewis1711: SUCESSS (maybe) 22:45 sw2wolf: yea 22:45 offby1: damn, now I have to find some other secret society to join 22:45 (quit) mizu_no_oto: Quit: ["Textual IRC Client: www.textualapp.com"] 22:46 lewis1711: http://pastebin.com/0mVqt2zM 22:46 jonrafkind: local-get-shadower?? 22:46 offby1: jonrafkind: it's for private detectives who are in an unfamiliar city. 22:46 lewis1711: is that a bad idea for some reason? 22:46 jonrafkind: i barely have any idea what it does.. most likely you have none :lp 22:47 lewis1711: you'd be right, i saw it on a blog :( 22:47 jonrafkind: ok i read the docs and i still have no idea 22:47 jonrafkind: its definitely the wrong thing 22:49 lewis1711: "ok i read the docs and i still have no idea" I know that feeling :D 22:50 jonrafkind: yes the lack of examples for a lot of the macro api makes it very hard 22:50 jonrafkind: take out the shadower thing and just do (datum->syntax #f 'self) 22:50 jonrafkind: as the argument to syntax-local-introduce 22:51 lewis1711: that also works 22:51 offby1: lewis1711: by the way, what you're doing -- making an ultra-simple object system in Racket -- has been done many times, so it should be easy to find examples on the web 22:53 lewis1711: that's true. I sorta wanted to forge ahead on my own for educational purposes though 22:54 offby1: fair enough 22:54 lewis1711: http://pastebin.com/ankUn6PP is there anyway to avoid having to write that out twice? 22:54 offby1: a _little_ cheating can help, though :) 22:54 (join) francisl 22:54 jonrafkind: just do args ... 22:54 jonrafkind: you dont need the () pattern 22:54 lewis1711: haha, true. if I can;t finish it this weekend i will then. but I'm almost done 22:55 jonrafkind: if there are no args then args ... will match the empty list 22:55 offby1: if there is no allah but allah ... 22:55 lewis1711: oh, I didn't know ... could do that. I thought it was 1 or more 22:56 lewis1711: cool, done 22:59 (join) jackhammer2022 23:03 lewis1711: thanks alot for your help jonrafkind 23:05 jonrafkind: sure 23:06 (quit) mithos28: Quit: mithos28 23:17 (quit) Nisstyre-laptop: Remote host closed the connection 23:18 (join) Nisstyre-laptop 23:23 (join) ambrosebs 23:33 (quit) francisl: Quit: francisl 23:42 (quit) sw2wolf: Quit: ERC Version 5.3 (IRC client for Emacs) 23:47 (quit) nathanpc: Quit: Computer has gone to sleep.