00:00 (join) jeapostrophe 00:03 (join) jesyspa 00:17 (quit) mithos28: Remote host closed the connection 00:18 (join) mithos28 00:20 (join) mithos28_ 00:21 (quit) mithos28_: Remote host closed the connection 00:21 (quit) mithos28: Read error: Connection reset by peer 00:21 (join) mithos28_ 00:29 (quit) blomqvist: Quit: You've got to hide your love away 00:30 (join) wahjava 00:31 (quit) veer: Quit: Leaving 00:32 (join) mithos28 00:32 (quit) mithos28_: Read error: Connection reset by peer 00:42 (quit) jeremyheiler: Quit: Computer has gone to sleep. 00:47 (join) weirdo 00:47 weirdo: hello 00:47 weirdo: i think i found a bug in r5rs mode 00:47 weirdo: racket@seaking2/ellipsis-patmatch> (pair? (vector-ref #(foo (1 2 3)) 1)) 00:47 weirdo: #f 00:47 weirdo: racket@seaking2/ellipsis-patmatch> (pair? '(1 2 3)) 00:47 weirdo: #t 00:51 (join) mithos28_ 00:52 (quit) mithos28_: Remote host closed the connection 00:52 (quit) mithos28: Read error: Connection reset by peer 00:53 weirdo: racket@seaking2/ellipsis-patmatch> pair? 00:53 weirdo: # 00:53 (join) mithos28 01:12 weirdo: the reader's broken in r5rs mode :( 01:13 neilv: if you file a bug, i suspect it will be fixed promptly 01:36 (join) rbarraud 01:37 (quit) jeapostrophe: Read error: Operation timed out 01:37 (join) gf3 01:38 (join) veer 01:41 veer: can this be shortened : 01:41 veer: (inexact->exact (truncate (exact->inexact (/ width max-width)))) 01:41 veer: where width > max-width and both are positive integers 01:44 veer: oh sorry please ignore my question 01:45 (quit) DrDuck1: Ping timeout: 244 seconds 02:00 (join) mceier 02:14 (join) hkBst 02:14 (quit) hkBst: Changing host 02:14 (join) hkBst 02:16 (quit) jacius: Remote host closed the connection 02:25 (quit) duomo: Quit: Linkinus - http://linkinus.com 02:45 (quit) rbarraud: Remote host closed the connection 02:47 (join) mithos28_ 02:50 (quit) mithos28: Ping timeout: 264 seconds 02:50 (nick) mithos28_ -> mithos28 02:56 (join) djcoin 02:59 djcoin: Is there a way in Racket to mark some datastructure as being immutable ? 02:59 djcoin: (Hi there ! :) ) 03:06 veer: djcoin: I think structures are immutable by default 03:07 jonrafkind: which datastructures are you looking at 03:08 djcoin: Well, I think I will rephrase my question because I have got no clue about how racket may handle immutability and that's what I was curious about :) 03:10 djcoin: So my question should be rather, how immutability is handled in racket, how can it be ensured ? 03:15 jonrafkind: by creating an immutable datastructure 03:15 veer: djcoin: its up to you to ensure that your data structure is immutable or you don't use any thing that mutate your data structure 03:15 jonrafkind: lists are immutable by default 03:15 jonrafkind: (hash) creates an immutable hash, if you want a mutable one you do (make-hash) 03:17 jonrafkind: structs are immutably by default unless you use the #:mutable keyword 03:20 djcoin: All right, thanks a lot. But mutable datastructure can leak from other library into your own code. Is there some good practice when designing library to yield only immutable one ? An ?immutable function to check ? 03:20 djcoin: Im just being curious here. Hope I dont bother :) 03:23 jonrafkind: theres (immutable? x) but i dont know if it works on absoltuely everything 03:23 jonrafkind: but your question is about designing a library so it sounds like you want a type system to ensure that you don't accidentally create mutable datastructures..? 03:23 jonrafkind: there is typed racket but honestly I dont know what it does in terms of mutability 03:24 jonrafkind: a quick guess is that it does not discern between mutable and immutable types 03:26 jonrafkind: it seems typed racket has (HashTable k v) but doesn't say anything about whether the hash is mutable or not 03:26 neilv: you could use contracts to keep mutable objects from coming in. or you could make macros that filter incoming objects to transparently convert them to immutable ones (which has its own problems) 03:27 (join) rbarraud 03:27 djcoin: All right, just wanted to make sure I did not miss some key concept of Racket with immutability 03:28 neilv: plt switching pairs to immutable was a big help to me. i wish they hadn't stopped at pairs 03:28 djcoin: Thanks a lot for your input 03:28 neilv: djcoin: you should ask on the email list 03:28 djcoin: Yeah 03:28 jonrafkind: yes, both (make-hash) and (make-immutable-hash) have the same type in TR 03:47 (quit) jonrafkind: Ping timeout: 246 seconds 04:09 (join) MayDaniel 04:26 weirdo: djcoin, why do you care at all? 04:26 weirdo: mutability has its places 04:27 djcoin: weirdo: Good question indeed. I was comparing to Clojure which only accept immutable one. And I think immutability is awesome for concurrent programming. So I was curious about how Racket handled that. 04:28 weirdo: there's no point to verify mutability on arbitrary data 04:29 weirdo: if you don't like it, don't mutate 04:29 weirdo: it's not like you can do anything with arbitrary typed data 04:30 djcoin: Sure "you" can choose not to mutate data. But what about the whole librairies, framework you may be using ? That was my point. 04:31 weirdo: so you're going to prevent the user of the library from passing mutable data to your code? 04:32 weirdo: also, nice abstractions can be build with mutable structures 04:32 weirdo: which hide away the mutability itself 04:32 weirdo: why don't create a new universe every tail-call while at that? 04:32 weirdo: eh, i'm wasting my time 04:33 djcoin: weirdo: So that was your response to immutability everywhere in clojure 04:33 djcoin: deep 04:33 weirdo: clojure has STM 04:33 weirdo: racket, hardly 04:41 (join) MightyFoo 04:42 MightyFoo: morning all 04:45 djcoin: moring 04:45 djcoin: morning * ! 04:47 (nick) MightyFoo -> tim-brown 04:58 (join) bitonic 05:00 (quit) jyc__: Read error: Connection reset by peer 05:09 (join) lcc 05:13 (quit) lcc: Quit: ERC Version 5.3 (IRC client for Emacs) 05:47 (quit) bitonic: Ping timeout: 246 seconds 05:54 (quit) ivan\: Ping timeout: 245 seconds 05:56 (join) ivan\ 06:03 (quit) ivan\: Ping timeout: 265 seconds 06:05 (quit) rbarraud: Ping timeout: 265 seconds 06:06 (join) antithesis 06:08 (join) ivan\ 06:26 (join) masm 06:43 (join) bitonic 06:48 (join) lcc 06:56 (join) snearch 07:04 (quit) neilv: Ping timeout: 246 seconds 07:32 (quit) lcc: Quit: ERC Version 5.3 (IRC client for Emacs) 07:51 (join) gciolli 07:54 (join) lcc 07:58 (quit) Shviller: Ping timeout: 246 seconds 07:58 (join) Shviller 09:02 aidy: djcoin: there are a few functional data structures on PLaneT 09:05 djcoin: aidy: thanks 09:05 (join) anRch 09:11 (quit) hkBst: Quit: Konversation terminated! 09:12 (join) jeapostrophe 09:14 (quit) snearch: Quit: Verlassend 09:22 (quit) masm: Quit: Leaving. 09:36 (quit) lcc: Quit: ERC Version 5.3 (IRC client for Emacs) 09:47 (join) gridaphobe 09:50 (quit) Shvillr: Read error: Connection reset by peer 09:55 (join) dnolen 10:06 (quit) mceier: Quit: leaving 10:07 (quit) anRch: Quit: anRch 10:08 (quit) jeapostrophe: Ping timeout: 240 seconds 10:08 (quit) MayDaniel: Read error: Connection reset by peer 10:21 (join) Kaylin 10:25 ozzloy: is there a way to escape strings for postgresql queries? 10:38 chandler: hm. what situation are you in that you're having trouble using parameters instead of escaped strings? 10:38 offby1: ozzloy: I'd assume that the built-in db access libraries did that for you 10:38 (quit) Kaylin: Quit: Leaving. 10:39 ozzloy: chandler, what are parameters in this context? 10:39 (quit) jrslepak: Quit: This computer has gone to sleep 10:40 chandler: ozzloy: parameters are things which get substituted for placeholders in your query 10:40 ozzloy: offby1, i'm thinking of the case (query-rows db (format "select * from users where id = ~a" id)) 10:40 chandler: e.g. (query-rows db "select foo from table where blah = $1" "this-is-a-parameter")) 10:41 chandler: ok, you definitely should be using parameters for that case, using the syntax I just gave 10:41 ozzloy: and id could contain something like "; drop everything" 10:41 ozzloy: ic 10:41 chandler: http://docs.racket-lang.org/db/query-api.html has a bunch of examples of this 10:41 ozzloy: i will have to look back at the docs 10:41 ozzloy: cool 10:42 chandler: see section 3.1 in particular: "Use parameters instead of Racket string interpolation (eg, format or string-append) to avoid SQL injection, where a string intended to represent a SQL scalar value is interpreted as—possibly malicious—SQL code instead." 10:43 ozzloy: cool 11:02 (quit) dnolen: Ping timeout: 246 seconds 11:04 (join) Shvillr 11:08 (join) jrslepak 11:13 asumu: djcoin: most data structures in Racket are built out of structures, so if the base structure is immutable there is no way to mutate it anyway. 11:14 asumu: And even if you implement something with mutation internally, you can export a pure interface (by simply not exporting mutating functions). 11:15 (join) nilyaK 11:15 asumu: The more interesting aspect of Clojure's data structures is that they are often persistent. 11:16 asumu: Which is not true of most Racket data structures, but that's not a fundamental limitation. They just haven't been designed to be. 11:18 (join) jeapostrophe 11:18 (quit) jeapostrophe: Changing host 11:18 (join) jeapostrophe 11:21 (join) mceier 11:28 djcoin: Thanks asumu. I'm not an expert of immutability/persistent/pure functional data structure. How do you define persistent ? Does it mean you can reuse any part of a persistent datastructure to make other immutable/persistent datastructure without worrying ? 11:37 (join) ssbr__ 11:43 asumu: djcoin: persistent means it preserves the old version of itself. In extreme cases, you can go through the entire history. 11:44 asumu: (and modified) 11:44 asumu: In Racket's case, they are persistent usually in the trivial sense that they are copied. 11:45 djcoin: asumu: Whats the difference with immutable ? It aims at the composable aspect of an immutable datastructure I guess ? 11:45 asumu: But Clojure's data structures usually implement persistence via sharing portions of the data structure between versions. 11:45 djcoin: Ok 11:46 asumu: Immutable and persistent mean different things. But persistent data structures are often immutable. 11:46 asumu: And immutable data structures are all persistent in a trivial sense. 11:47 (join) MayDaniel 11:47 asumu: (so when I say persistent, I really mean they are implemented with efficient sharing) 11:48 asumu: Anyway, it would be nice to more data structures like that in Racket. I think it's just a matter of people spending the time to implement them. 11:48 asumu: *to have more 11:49 djcoin: Yeah 11:50 djcoin: I will document myself more on this (even If I read a few stuff around I still have problem figuring out the difference with persitence/immutability etc.) 11:51 djcoin: Thanks a lot for your explanations 11:53 asumu: djcoin: here's an example. In Racket, vectors can be immutable, but I think they are still implemented the same or in a similar way as mutable ones. And they just copy on operations. 11:53 asumu: In Clojure, vectors are really trees: http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/ 11:53 rudybot: http://tinyurl.com/ap5chf 11:55 asumu: And if you just change part of it, you don't have to copy the whole tree. Just the relevant sub-trees. 11:56 djcoin: asumu: And what are your thoughts about forcing the whole language to have such immutable datastructure ? Seems good for concurrent application (if you need such application of course) 11:56 djcoin: I for one does not have such need in fact, but I find it interesting 12:00 djcoin: But I won't bother you more - I guess I will come back later when I will have more clue about all this 12:01 asumu: I think I'd prefer to provide both, but I don't really know either. 12:08 (quit) nilyaK: Quit: Leaving. 12:09 (join) nilyaK 12:15 (quit) veer: Quit: Leaving 12:35 (join) mithos28 12:36 (join) anRch 12:42 (quit) djcoin: Ping timeout: 246 seconds 12:57 (quit) mithos28: Quit: mithos28 13:05 (quit) anRch: Quit: anRch 13:27 (join) jacius 13:27 (join) jonrafkind 13:27 (quit) jonrafkind: Changing host 13:27 (join) jonrafkind 13:31 (join) lcc 14:03 (join) carleastlund 14:11 (quit) lcc: Quit: fuzzy logic 14:11 (quit) bitonic: Quit: ERC Version 5.3 (IRC client for Emacs) 14:12 (join) lcc 14:17 (join) anRch 14:22 (quit) gciolli: Ping timeout: 248 seconds 14:52 (join) RacketCommitBot 14:52 RacketCommitBot: [racket] plt pushed 2 new commits to master: http://git.io/IzqV2Q 14:52 RacketCommitBot: [racket/master] Add examples for most class clauses. - Asumu Takikawa 14:52 RacketCommitBot: [racket/master] Fix class init grammar in docs - Asumu Takikawa 14:52 (part) RacketCommitBot 15:00 (join) soegaard 15:00 (quit) antithesis: Remote host closed the connection 15:09 (join) antithesis 15:12 (quit) antithesis: Remote host closed the connection 15:14 (quit) anRch: Quit: anRch 15:24 (join) bitonic 15:24 (quit) bitonic: Remote host closed the connection 15:26 (join) bitonic 15:38 (quit) bitonic: Remote host closed the connection 15:40 (join) jyc 15:46 (join) bitonic 15:54 (join) adu 15:58 (join) jeremyheiler 15:59 (part) ChibaPet 16:14 (quit) jacius: Remote host closed the connection 16:24 (join) rbarraud 16:29 (join) RacketCommitBot 16:29 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/q0K2JQ 16:29 RacketCommitBot: [racket/master] Fix Performance Report on unsaved editors. - Vincent St-Amour 16:29 (part) RacketCommitBot 16:30 (quit) nilyaK: Quit: Leaving. 16:32 (quit) rbarraud: Read error: Connection reset by peer 16:38 (quit) jrslepak: Quit: This computer has gone to sleep 16:40 (quit) MayDaniel: Read error: Connection reset by peer 16:43 (join) antithesis 16:53 (quit) antithesis: Remote host closed the connection 16:54 (quit) jesyspa: Quit: leaving 17:08 (join) Fare 17:10 (join) rbarraud 17:11 (quit) gridaphobe: Remote host closed the connection 17:14 (quit) rbarraud: Read error: Connection reset by peer 17:19 (quit) cdidd: Ping timeout: 240 seconds 17:19 (join) gridaphobe 17:22 (quit) stamourv: Remote host closed the connection 17:26 (join) stamourv 17:26 (quit) stamourv: Changing host 17:26 (join) stamourv 17:35 (join) cdidd 17:41 (quit) soegaard: Quit: soegaard 17:43 (join) rbarraud 17:44 (join) Kaylin 17:50 (quit) rbarraud: Read error: Connection reset by peer 17:50 (join) rbarraud 17:51 (join) DrDuck 18:06 (join) jacius 18:06 (quit) jeremyheiler: Quit: Computer has gone to sleep. 18:07 (quit) mceier: Quit: leaving 18:10 (quit) jeapostrophe: Ping timeout: 250 seconds 18:13 (join) Urm3l 18:20 (quit) rbarraud: Read error: Connection reset by peer 18:22 (join) rbarraud 18:35 (join) djcoin 18:51 (quit) adu: Quit: adu 19:02 (quit) Urm3l: Quit: Urm3l 19:04 (quit) rbarraud: Read error: Connection reset by peer 19:12 (join) jrslepak 19:22 (quit) jyc: Ping timeout: 244 seconds 19:35 (quit) djcoin: Quit: WeeChat 0.3.2 19:45 (join) jeremyheiler 19:47 (quit) jonrafkind: Ping timeout: 248 seconds 19:52 (join) dnolen 19:57 (quit) carleastlund: Quit: carleastlund 20:15 (quit) stchang: Read error: Operation timed out 20:18 (join) stchang 20:19 (quit) bitonic: Ping timeout: 246 seconds 20:32 (quit) dnolen: Ping timeout: 248 seconds 20:42 (join) bitonic 21:36 (join) dalaing 21:47 (join) jeapostrophe 21:49 (join) jyc 22:04 (quit) gridaphobe: Remote host closed the connection 22:05 (quit) bitonic: Ping timeout: 246 seconds 22:07 (quit) jeapostrophe: Ping timeout: 250 seconds 22:07 (join) jeapostrophe 22:26 (join) mmalorni 22:37 (quit) jeapostrophe: Read error: Operation timed out 22:38 (quit) jeremyheiler: Quit: Computer has gone to sleep. 22:39 (nick) Aethaeryn -> nyreahtea 22:42 (quit) lcc: Quit: ERC Version 5.3 (IRC client for Emacs) 23:01 (join) lcc 23:06 (join) rbarraud 23:11 (join) jonrafkind 23:15 eli: Fare: So, something like this? -- http://tmp.barzilay.org/x 23:16 Fare: a bit like this, yes 23:17 Fare: except that the listof can be recursively used, and for each use, a new function is defined, though structurally equal expressions have the same underlying function. 23:17 eli: (Actually, slightly revise it to say that (sum 12) could throw a syntax error otherwise it could be done with plain functions.) 23:18 Fare: yes 23:20 (join) jeapostrophe 23:20 (quit) jeapostrophe: Changing host 23:20 (join) jeapostrophe 23:21 asumu: rudybot: (define foo (listof integer?)) 23:21 rudybot: asumu: your sandbox is ready 23:21 rudybot: asumu: Done. 23:21 asumu: rudybot: (foo 12) 23:21 rudybot: asumu: ; Value: #f 23:21 asumu: rudybot: (foo '(1 2)) 23:21 rudybot: asumu: ; Value: #t 23:21 asumu: (I have no context, so I have no idea what that example was about though) 23:22 (join) BeLucid_ 23:22 asumu: (just thought it was cute that the contract works here) 23:22 (quit) BeLucid: Ping timeout: 246 seconds 23:22 eli: asumu: That's not coincidental, given the person who wrote that example... 23:23 asumu: eli: you? 23:24 eli: Yes. 23:24 Fare: I suppose that one could trust the compiler to do some common expression elimination at the module and/or global level to eliminate duplicates of identical contracts. 23:25 asumu: eli: FYI, Google has now adopted your meta description in search. Sitelinks are still weird. 23:25 eli: Fare: That would be easy with some memoization of things like `listof' 23:25 eli: asumu: It did?? 23:26 Fare: eli: is that memoization user-controllable? 23:26 eli: asumu: Whoa -- Yes... I actually checked it earlier today, and noticed only that the bogus sitelinks are there... 23:26 Fare: also, normalizing the things that are to be memoized can be "interesting" in presence of scoping. 23:27 eli: Fare: Well, the point is that whatever you do with that memoization is independent of how you'd implement it. 23:28 Fare: also, what about memoizing the stuff at runtime as well as at syntax time? 23:29 eli: No problem with that, you'd have two different memoization tables, one for each level. 23:29 Fare: at what point is the runtime one filled? 23:29 Fare: since I'm not at a code point, I can't expand into code that fills the runtime table. 23:29 eli: When the module is invoked. 23:30 Fare: so I need to expand into code that will be run at module init time or such 23:31 Fare: and/or somehow emit annotations that are collected by whichever program creates the module expansion. 23:31 eli: Module-toplevel code gets to run when you invoke the module, so that part is easy. 23:34 Fare: any macro can register module-toplevel code in addition to expanding into something fit for the current scope? 23:34 (join) siduction 23:35 Fare: is probably even more important for syntax-parse kind of macros -- you might want more levels than just module-toplevel and current point. 23:35 eli: There are "lift" macros that expand into code that gets lifted into the module's toplevel. 23:35 eli: But I suspect that you don't need those. 23:36 Fare: i.e. for call-by-exploded-structure kind of lambda-parameter macros, you'd want to expand into both several parameters in the lambda-list and code that wraps around the body of the lambda to do funky things with bindings 23:37 (join) vu3rdd 23:37 (quit) vu3rdd: Changing host 23:37 (join) vu3rdd 23:41 eli: Fare: I don't know what you mean by that... 23:41 (quit) dalaing: Quit: Leaving. 23:41 eli: Which is why I suggested an incremental thing towards what you really want... 23:41 eli: In any case, I got delayed due to a stupid mistake, and due to munching. 23:41 eli: How about this: 23:42 eli: http://tmp.barzilay.org/x 23:42 eli: (reload) 23:42 (join) dalaing 23:42 (part) dalaing 23:44 Fare: in the CL example, the list-of need not appear in a deftype, but in any expression in the type sublanguage. 23:45 eli: It's possible to write a compiler kind of thing that would start from, say, (Listof Integer) and "compile" it to a runtime expression like (listof integer?) 23:47 Fare: of course - but whichever processors accepts the sublanguage then needs to be somehow extended to account for the macro. 23:48 eli: You mean make the type expression be a normal expression? 23:51 (quit) rbarraud: Read error: Connection reset by peer 23:52 (join) rbarraud 23:53 (join) veer 23:56 Fare: no, it's never gonna be a normal expression 23:56 Fare: it's processed by a different processor