00:34 (join) neilv
00:34 (quit) neilv: Changing host
00:34 (join) neilv
02:07 (quit) neilv: Ping timeout: 260 seconds
02:08 (part) shofetim: "ERC Version 5.3 (IRC client for Emacs)"
02:20 (join) neilv
02:32 (join) dnolen
02:43 (quit) dnolen: Quit: dnolen
03:11 (join) DT``
03:38 (quit) ^mye^: Ping timeout: 255 seconds
05:07 (join) Fisherman
05:37 (join) mceier
05:45 (quit) abbe: Changing host
05:45 (join) abbe
06:06 (join) MayDaniel
06:30 (join) tfb
06:40 (quit) tfb: Quit: gone
07:03 (join) lucian_
07:11 lithpr: does racket have support for xpath?
07:13 neilv: there is a xpath library in planet
07:13 lithpr: no, but i've found similar things in the mailing list- nevermind :)
07:13 neilv: http://planet.racket-lang.org/display.ss?package=sxml.plt&owner=lizorkin
07:14 lithpr: thanks!
07:15 (nick) kontenbaffer -> octopaedos
07:17 lithpr: zomg that's cool
07:18 neilv: oleg kiselyov originally wrote sxpath
07:53 (nick) lucian_ -> lucian
07:54 (quit) lithpr: Read error: Connection reset by peer
08:01 octopaedos: SXML is awesome
08:01 octopaedos: I'm trying to get them on #xml to switch.
08:03 bremner_:
08:03 octopaedos: Ahaha
08:03 octopaedos: Well, it actually has a reason
08:03 octopaedos: Like, I spoke to the guy behind xml there. And he's a big fan of syntactic salt.
08:03 neilv: the xml standards are a nightmare
08:03 octopaedos: He likes his matching opening and closing tags.
08:03 octopaedos: neilv, why?
08:03 neilv: keep those people away from racket
08:04 octopaedos: I think the tree is kind of cool and all the semantics stuff they have done. But the standard repraesentation is juts overly verbose, also, I don't like the fact that the syntax for namespaces is so similar to that of attrbutes
08:05 octopaedos: But they don't really like that themselves, but they didn't have a better idea or something.
08:30 (join) Lajla
08:31 (join) lithpr
08:33 (quit) octopaedos: Ping timeout: 276 seconds
08:36 (quit) lithpr: Remote host closed the connection
08:46 (join) tauntaun
09:06 (join) masm
09:09 (join) lithpr
09:18 (quit) drhodes: Quit: Reconnecting
09:18 (join) drhodes
10:11 tauntaun: Good morning. Any reason why Racket's hashtables don't have functions hash-empty? and hash-cardinality? (number of key-value associations). AFAICT, one has to do (compose length hash->list).
10:12 Lajla: hashtable-size
10:12 Lajla: Is r6rs
10:12 Lajla: No idea if racket does the same
10:13 tauntaun was asking about Racket, not R6RS. But thanks anyway...
10:15 Lajla: tauntaun: http://docs.racket-lang.org/reference/hashtables.html#(def._((quote._~23~25kernel)._hash-count))
10:15 Lajla: apparently
10:16 tauntaun: hmmm, I read that page earlier this morning and missed hash-count. Thanks, Lajla.
10:17 Lajla: I never read that page in my life.
10:17 Lajla: And I got it right in one go.
10:17 Lajla: I am a marvel.
10:19 tauntaun: I guess this leads to a more general (and probably naive) question: Why did the PLT group feel the need to define their own hashtables? What was found lacking in the R6RS definition?
10:20 Lajla: racket is older than r6rs
10:20 Lajla: And r6rs is kind of bad in 'standardizing', but in their defence, it's hard to standardize scheme since every implementation has its own ideas.
10:20 Lajla: r5rs didn't have hashes.
10:20 Lajla: I'm partial towards hashtable-length though
10:21 tauntaun: I know that Racket is older than R6RS. But I didn't know that r5rs didn't have hashtables. Thanks for illuminating.
10:21 Lajla: I would double check to see if R5 specifies +
10:22 tauntaun: perhaps not the arity.
10:22 Lajla: R4 I believe didn't require syntax-rules eiher.
10:22 Lajla: Well, it does.
10:22 Lajla: but not with -
10:22 Lajla: It specifies how - and / should behave with more than two.
10:23 Lajla: But leaves its support optional.
10:23 Lajla: R6 hashtables also work in a some-what different fashion I see here, so you can't just make aliases.
10:26 tauntaun: It's a pity R6RS doesn't define sets...or am I being blind again?
10:30 Lajla: tauntaun, it doesn't as far as I know.
10:30 Lajla: But in most languages, sets are basically hashtables whose keys aequal their values.
10:32 tauntaun: Speaking of hashtables, am I correct in seeing that R6RS's definition doesn't support functional updates?
10:32 Lajla: tauntaun, what's a 'functional update'?
10:32 tauntaun: An alternative to mutation, in which most of the older version of the data structure is reused in a newly allocated one.
10:33 Lajla: Ahhh
10:33 Lajla: Like, it returns a new one?
10:33 tauntaun: For example, there are two ways to change '(1 2 3 4) to '(one 2 3 4).
10:33 tauntaun: The imperative is to use set-car!
10:33 tauntaun: The functional is, as you know, ....
10:34 Lajla: Yeah, I know what you mean here
10:34 Lajla: tauntaun, well, there are immutable hashtables, I guess it's up to implementations to optimize what they can.
10:39 tauntaun: Yes, R6RS has hashtable-copy, but I'm not sure what good that does, given that there is no functional update (equivalent of Racket's hash-set).
10:39 Lajla: tauntaun, well, you can write one
10:39 Lajla: It also doesn't have one for vectors or lists.
10:40 Lajla: You can write one, how much it optmizes is up to the implementation, which might provide one natively to guarantee further optimization
10:40 tauntaun: I'm not sure a functional update function can be written without knowing the implementation, which rather defeats the purpose, no?
10:42 Lajla: tauntaun, I mean, you can write a function which performs a functional update, whether the implementatoin optimizes this to re-use the structure internally is not something R6 specifies.
10:43 Lajla: It's not really a language that is known for its concern about performance.
11:19 (join) evhan
11:21 (join) dnolen
11:32 (quit) neilv: Ping timeout: 255 seconds
11:37 (join) neilv
11:49 (join) PLT_Notify
11:49 PLT_Notify: racket: master Mike Sperber * 2bdb988 (1 files in 1 dirs): Don't pop up test-engine window upon innocent REPL interaction. ... - http://bit.ly/fkd75F
11:49 (part) PLT_Notify
11:50 (join) evhan_
11:52 (quit) dnolen: Quit: dnolen
11:53 (quit) evhan: Ping timeout: 248 seconds
11:54 (nick) evhan_ -> evhan
11:58 (quit) evhan: Read error: No route to host
11:58 (join) evhan
12:09 (quit) MayDaniel: Read error: Connection reset by peer
12:24 tauntaun: Does anyone else find that a fresh call to make- is a little easier than using struct-copy?
12:25 offby1: I can imagine
12:25 tauntaun: Is stuff happening under the hood during a call to struct-copy that makes it preferable to a fresh make-?
12:30 neilv: if you want to do a shallow copy of a struct, i would guess that using struct-copy makes sense, both readability- and performance-wise
12:33 neilv: one operation that would be nice is a struct copy with selective overriding of individual fields
12:33 tauntaun: neilv: that's exactly what struct-copy does
12:34 neilv: ah, i see. duh
12:34 tauntaun: And it's precisely that syntax that makes it rather *less* readable, IMO.
12:34 tauntaun: Seems much easier just to do a fresh make-.
12:35 tauntaun: Actually, I should take some of that back.
12:35 neilv: let's say you're copying a struct with 8 fields, and want to modify 2 of them
12:35 tauntaun: Right, right.
12:35 tauntaun: You've read my mind.
12:40 (join) MayDaniel
12:43 tauntaun: So here's an observation. I'm trying to implement a simple graph API. My first implementation used the adjacency list representation and used Scheme lists and alists throughout. The second uses Racket's structs and its many attractive sequence APIs (sets and hashtables). Interestingly, the code for the second implementation is much more bloated and thus paradoxically feels rather less "functional." Any thoughts?
12:48 (join) ^mye^
12:49 neilv: if you're using alists as you would fields of the struct (i.e., not do things like shared tails of alists, not iterating over fields, not doing field lookup given only a symbol from some data source when a procedure couldn't be used as easily, etc.), i would probably use structs
12:50 tauntaun: Actually I'm not using alists as fields of the struct. I'm using them to represent graph nodes and their neighbors (adjacency-list representation).
12:50 tauntaun: And I was representing the entire graph as a list of nodes.
12:50 tauntaun: Clearly not very efficient for lookup.
12:51 tauntaun: But amenable to much more concise code.
12:51 tauntaun: (Because of map, compose, curry, filter, fold, flip, etc.)
12:55 neilv: what about hashes? (alist lookups are fairly fast in practice, but algorithmically they are slow, and updates are expensive if they're immutable)
12:57 neilv: structs (whether you use hashes or not) might make it easier to associate data with both edges and vertices
12:58 neilv: otoh, alists are easy to represent literally in code, and easy for racket to write and read
13:00 tauntaun: hashes are exactly what I've used, though encapsulated by the dict API.
13:00 tauntaun: The irony is that the API has somehow forced a bloating of the code.
13:01 (part) Fisherman
13:10 neilv: maybe you can find some opportunity for macros
13:17 tauntaun: wow...you're just one step behind me :)
13:17 tauntaun: I did just use let-syntax to try to neaten things up.
13:18 tauntaun: (neilv, I should have pinged you before typing...)
13:31 tauntaun: OK, by now I probably sound like I'm griping...but I have to ask: Why does racket/set lack set-cardinality?
13:31 tauntaun: (or set-size, or set-count)
13:31 (join) dnolen
13:33 (quit) tauntaun: Quit: Ex-Chat
14:02 lithpr: when running the racket executable as a repl, it does not recognize #lang racket
15:13 (join) shofetim
16:23 (nick) cpach_ -> cpach
16:37 (quit) neilv: Ping timeout: 252 seconds
16:39 (quit) mceier: Quit: Lost terminal
16:40 (join) mceier
16:49 (quit) evhan: Ping timeout: 240 seconds
16:51 (join) evhan
17:16 (join) tauntaun
18:14 (quit) dnolen: Quit: dnolen
18:26 (quit) corruptmemory: Remote host closed the connection
18:32 lithpr: the curried function shorthand is pretty slick
18:42 (join) coyotama|2
18:46 (quit) coyo: Ping timeout: 264 seconds
18:47 (join) dnolen
18:54 tauntaun: lithpr: how does that work?
18:54 tauntaun searches plt-help...
18:57 (quit) MayDaniel: Read error: Connection reset by peer
19:00 lithpr: (define ((make-add-suffix s2) s)
19:00 lithpr: (string-append s s2))
19:00 tauntaun: yeah, I found that.
19:01 (join) jonrafkind
19:01 tauntaun: I was hoping for a notation that lets you curry functions anonymously, e.g., something terser than (curry map sqr).
19:01 tauntaun: In Haskell, you would just write "map sqr"
19:03 (quit) saint_cypher: Quit: Leaving.
19:07 jonrafkind: i suppose you cuold write a new language level where everything was curried
19:08 tauntaun: Yes, but in Scheme that would only proliferate parentheses further.
19:09 tauntaun: Although, I guess with enough macros you could indeed pull it off.
19:30 DT``: tauntaun, you just need a modified lambda and #%app, that transform (λ (x y) ...) to (λ (x) (λ (y) ...)) and (f x y) to ((f x) y).
19:32 tauntaun: Yes, I was thinking along those lines.
19:33 tauntaun must disappear for a few minutes (change of location). Please don't say anything interesting.
19:33 (quit) tauntaun: Quit: Ex-Chat
19:51 (join) tauntaun
19:59 (join) evhan_
20:01 (quit) evhan: Ping timeout: 260 seconds
20:37 (join) neilv
20:50 (quit) mceier: Quit: leaving
20:52 tauntaun: check-expect doesn't seem to work.
20:54 offby1: repro
20:56 tauntaun: ?
20:57 offby1: tauntaun: can you paste a small bit of code that demonstrates check-expect not working properly?
20:57 tauntaun: offby1: (check-expect (list) 13)
20:58 tauntaun: rudybot: (check-expect (list) 13)
20:58 rudybot: tauntaun: your sandbox is ready
20:58 rudybot: tauntaun: error: reference to undefined identifier: check-expect
20:58 offby1: what should it do? What does it do instead?
20:58 tauntaun: I *thought* it would complain.
20:58 tauntaun: It does nothing.
20:58 tauntaun: rudybot: (require test-engine/racket-tests)
20:58 rudybot: tauntaun: Done.
20:58 tauntaun: rudybot: (check-expect (list) 13)
20:58 rudybot: tauntaun: ; stdout: "Ran 1 check.\n0 checks passed.\n\tActual value () differs from 13, the expected value.\n At line 1 column 0\n"
20:58 tauntaun: Well that's encouraging.
20:59 tauntaun: But it doesn't work in MzScheme.
20:59 offby1: gosh, I didn't know about test-engine
20:59 tauntaun: Where did you think check-expect lived?
21:00 offby1: not sure I ever used it
21:00 offby1: I'd'a guessed schemeunit
21:00 tauntaun investigates schemeunit
21:00 tauntaun: offby1: plt-help search doesn't recognize the keyword "schemeunit"
21:02 offby1: maybe it's "rackunit" now
21:04 tauntaun: OK, rackunit works fine. Many thanks...
21:13 (quit) neilv: Ping timeout: 255 seconds
21:34 (quit) masm: Ping timeout: 255 seconds
21:55 (join) masm
21:58 (quit) lithpr: Ping timeout: 255 seconds
21:58 (join) corruptmemory
22:11 (join) mheld
22:12 (quit) masm: Ping timeout: 240 seconds
22:32 (quit) tauntaun: Quit: Ex-Chat
22:42 (join) tauntaun
22:50 (quit) tauntaun: Ping timeout: 264 seconds
23:18 (join) mye^
23:21 (quit) ^mye^: Ping timeout: 240 seconds
23:51 (quit) lucian: Remote host closed the connection
23:59 (quit) dnolen: Quit: dnolen