; given: #f
14:03 stamourv: Heh.
14:03 dyoo: Uh, didi, can you try evaluating that snippet? :)
14:03 stamourv: rudybot: (banner)
14:03 rudybot: stamourv: ; Value: "Welcome to Racket v5.2.900.1.\n"
14:04 stamourv: That may be the issue.
14:04 didi: dyoo: Sure.
14:04 didi: dyoo: `"How do Americans…<a\n href=\"http://howe.iki.rssi.ru/GCTC/gctc_e.htm\">Star City
"'
14:05 (quit) mye: Ping timeout: 260 seconds
14:05 (nick) mye_ -> mye
14:05 dyoo: So the fact that it's breaking up the less than and greater than into separate chunks doesn't affect how it renders to xml later on.
14:05 dyoo: That is, it's not introducing spaces: it's just breaking up the string into multiple chunks. XML does that.
14:06 didi: dyoo: So each chunk has whitespaces around it?
14:07 (join) untrusted
14:07 dyoo: More concretely, if you parse something like "hello world
", it's technically possible to get back as an xexpr: '(p "h" "e" "l" "l" "o" " " "w" "o" "r" "l" "d")
14:07 dyoo: (It probably won't happen, but it's not illegal)
14:07 dyoo: Each chunk does _not_ represent whitespace.
14:07 dyoo: or should not be interpreted as having whitespace around it.
14:08 didi: So who is adding them?
14:09 dyoo: didi: the xml parser is allowed to chunk string content however it wishes. Some chunk because they have fixed buffer size. Others chunk where it might simplify the internal implementation. But this is just something that XML does: it's not a Racket thing.
14:09 dyoo: which is another reason why I don't like XML, but that's besides the point. :)
14:10 (quit) mithos28: Quit: mithos28
14:11 didi: dyoo: Well, but it has practical implications. While it's still valid, it changes the text. If you end a sentence with a link, for example, now you have a new whitespace before `.' Or now you have double spaces between things.
14:11 dyoo: No, there are _no_ extra spacing being introduced. Example:
14:12 didi: OIC.
14:12 didi: It's a list.
14:12 didi: It's not a string.
14:12 dyoo: right
14:13 didi: Dumb didi.
14:13 didi: dyoo: Thank you!
14:13 dyoo: didi: https://gist.github.com/4227342
14:14 asumu: dyoo: BTW, is this relevant for you? (WeScheme, etc.) http://www.cs.uni.edu/~wallingf/blog/archives/monthly/2012-11.html#e2012-11-28T18_34_12.htm
14:14 rudybot: http://tinyurl.com/a5sffb9
14:14 dyoo: Yup. But it's definitely one of those things that trip people up using xml: it's all too easy to assume that if you have an xexpr with text, that it only has one child element. And that's absolutely not the case: the text can be broken up into multiple children chunks.
14:15 didi: dyoo: Thank you for the help and patience.
14:16 dyoo: asumu: relevant. Thank you!
14:24 mye: dyoo: data/order looks like it could do what I want. I don't understand how to apply it to sets though.
14:25 mye: is this something I'd use when implementing my own sorting algo?
14:26 (quit) mizu_no_oto: Quit: ["Textual IRC Client: www.textualapp.com"]
14:26 dyoo: mye: I believe it provides tools for defining your own comparators, which can be used for sorting.
14:28 (join) mizu_no_oto
14:29 (join) nejucomo
14:29 mye: Probably a method to order a set could make direct use of the data structure the set is implemented with. So I don't think there's a "better" way than set->list without adding an internal function
14:30 dyoo: mye: yeah, but my understanding is sets are implemented with hash tables, in which case it's not ordered, but rather organized through equal-hash-code or eq-hash-code (modulo hash table size).
14:32 dyoo: I did code up a red-black tree implementation that might come in handy for you: https://github.com/dyoo/data-red-black
14:43 (quit) nejucomo: Ping timeout: 276 seconds
14:50 (join) masm
15:05 (join) Kaylin
15:08 (join) nejucomo
15:09 (quit) samth_: Ping timeout: 240 seconds
15:28 (join) mithos28
15:44 (join) RacketCommitBot
15:44 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/wRxoyg
15:44 RacketCommitBot: racket/master 6e02d12 Neil Toronto: Reimplemented `mpfr_set_z_2exp' in Racket as a fallback for older versions...
15:44 (part) RacketCommitBot
15:46 (quit) jonrafkind: Ping timeout: 248 seconds
15:47 (join) gatlin
15:57 (quit) untrusted: Remote host closed the connection
15:58 dyoo: mye: for example of something quick-and-dirty to code up ordered sets: https://github.com/dyoo/data-red-black/blob/ordered-set/data/red-black/ordered-set.rkt
15:58 rudybot: http://tinyurl.com/a69p3cs
16:00 (join) jonrafkind
16:00 (quit) jonrafkind: Changing host
16:00 (join) jonrafkind
16:05 mye: dyoo: that's awesome!
16:06 mye: I'll definitely try this (when I figure out planet2 anyway)
16:06 dyoo: mye: not heavily tested: I just coded this up 10 minutes ago. ;) But it should hopefully not break too badly. If you don't want to use planet2 for the moment, just check out the repo
16:07 dyoo: go into the directory, and then just raco link it in. Let me try it in racket 5.3.1 to make sure this actually works.. :)
16:08 dyoo: Yeah, you should be able to do something like this:
16:08 dyoo: git checkout git://github.com/dyoo/data-red-black.git && raco link -d data-red-black
16:09 samth: dyoo: there's an 'update' button on planet2, btw
16:15 dyoo: mye: oh, whoose, got the checkout line wrong. It's: git clone git://github.com/dyoo/data-red-black.git && git checkout ordered-set && raco link -d data-red-black
16:15 dyoo: mye: since the ordered-set stuff is still half-baked, I put it in a separate branch (not master)
16:17 mye: dyoo: thx. How do I require it after linking? there doesn't seem to be an example in the raco link docs.
16:18 dyoo: no documentation yet, but see: https://gist.github.com/4228535 for an example interaction
16:18 dyoo: I just coded this thing up between 12:32pm and 1:58pm, and I need to get lunch! :)
16:19 mye: dyoo: enjoy your meal!
16:21 dyoo: (gah, ordered-set->list has a borken contract. I knew I should have tested the external interface…)
16:22 (quit) dyoo: Quit: dyoo
16:22 mye: looks like I need to restart drracket for it to get the new link table :) dyoo I'll manage, go get your meal
16:22 mye: aww, 1 sec late
16:23 didi: Hum, `se-path*/list' seems to append all the values specified by the path but it might be more useful to have a list of values.
16:24 didi: rudybot: (require xml/path)
16:24 rudybot: didi: Done.
16:25 didi: rudybot: (se-path*/list '(p) '(html (body (p ([class "awesome"]) "Hey" "Your") (p "Bar"))))
16:25 rudybot: didi: error: car: expects argument of type ; given: #f
16:25 didi: rudybot: eval (se-path*/list '(p) '(html (body (p ([class "awesome"]) "Hey" "Your") (p "Bar"))))
16:25 rudybot: didi: error: car: expects argument of type ; given: #f
16:25 didi: Oh well.
16:26 didi: => '("Hey" "Your" "Bar")
16:26 didi: You don't know how many matched nor can process each one separately.
16:27 didi: As in (map process (se-path*/list ...))
16:28 (quit) mizu_no_oto: Quit: ["Textual IRC Client: www.textualapp.com"]
16:29 (quit) mithos28: Quit: mithos28
16:30 (join) mizu_no_oto
16:41 mye: weird, to remove a link (I added $HOME by accident) raco link -r ~ should work right?
16:41 mye: I get path-element->string: contract violation expected: path? given: 'up
16:43 stamourv: mye: I don't know if ~-expansion works in that context.
16:43 mye: and (require data/red-black/ordered-set) works in a terminal racket but not drracket
16:43 stamourv: But I agree that the error message is pretty bad.
16:44 stamourv: The error message alone makes this worth a bug report, IMO.
16:44 mye: stamourv: I tried absolute path, same thing
16:44 stamourv: Oh, that's weird, then.
16:44 mye: stamourv: I believe the raco command wouldn't even see the tilde
16:45 mye: but the $HOME really IS linked -.-
16:45 stamourv: I'm a bit rusty on shell expansion rules, so maybe.
16:47 mye: stamourv: when I added $HOME I think I used (in ~): raco link .
16:47 mye: that might cause this error
16:47 (join) dyoo
16:47 mye: but I'm not sure what raco link sees in this case
16:50 stamourv: What's the output of "raco link -l"?
16:51 mye: "/Users/lo/" and "/Users/lo/build/data-red-black"
16:52 mye: and I just found out that (find-system-path 'links-file) has two different values for terminal racket and drracket (from I'm quite sure) the same installation
16:52 stamourv: Right, probably one for user links and one for installation links.
16:53 stamourv: Ok, try that: "raco link -r -n lo"
16:54 mye: stamourv: [no links removed] it says
16:55 (part) mye
16:55 stamourv: What if you throw in "--repair", or "-i"/"-u" (depending on the kind of link).
16:55 (quit) kofno: Remote host closed the connection
16:56 (join) mye
16:56 (quit) mye: Quit: mye
16:56 (join) mye
16:56 mye: test (disc)
16:57 stamourv: Have you tried editing the links file manually?
16:57 mye: stamourv: was about to do :)
16:59 mye: stamourv: it has (root "../../../") for the $HOME, I presume that causes an error
16:59 (quit) hash_table: Ping timeout: 260 seconds
16:59 stamourv: Yeah, that looks wrong.
17:04 mye: what could explain that racket > (find-system-path 'links-file) sees but DrRacket sees /Users/lo/Library/Racket/links.rktd (which does not exist) /Users/lo/build/plt/add-on/links.rktd ?
17:05 mye: eh, that last path is what terminal racket sees
17:05 stamourv: Do you have 2 Racket installations?
17:06 mye: stamourv: both say they're 5.1.3.9 and of that I'm sure I have only the one. But maybe there's another one somewhere
17:06 (quit) tilde`: Quit: BBL
17:09 stamourv: How did you install Racket?
17:09 mye: stamourv: git
17:09 stamourv: In-place install?
17:09 stamourv: Or prefix?
17:10 mye: in-place
17:10 mye: and I use these script to set PLT_HOME
17:10 mye: maybe the cmdline racket actually uses that?
17:10 stamourv: Which scripts?
17:11 mye: https://github.com/takikawa/racket-dev-goodies
17:12 (quit) gatlin: Ping timeout: 264 seconds
17:12 stamourv: Right, I use these too.
17:12 mye: maybe I should just soft-link the two files so drracket is happy?
17:12 stamourv: They depend on having symlinks for `racket', `drracket', etc. right?
17:12 stamourv: Are you launching DrRacket via that symlink?
17:14 mye: stamourv: It IS the env. variable. I started one from the doc and one from the terminal and the terminal drracket sees the same link file
17:14 stamourv: Ah, interesting.
17:15 stamourv: So making the dock icon point to the symlink sounds like it should fix the problem.
17:17 (quit) MayDaniel: Read error: Connection reset by peer
17:17 mye: I don't think one can add symlinks as dock items, probably requires editing some plists. And the PLTHOME variable is not set globally (on mac, it's weird, must use launchd or something).
17:20 stamourv doesn't know anything about macs.
17:20 stamourv: Correction: stamourv doesn't know anything about Mac OS.
17:21 stamourv is running Debian on an old mac mini hand-me-down.
17:21 mye: stamourv: grepping through the source, PLTHOME:is used 4 times in src and lots of times in collects/
17:22 mye: so somewhere there must be logic to set the links file to ~/Library/Racket when PLTHOME is not set
17:22 stamourv: None of the uses in collects/ should matter.
17:23 stamourv: And the ones in src/ don't look relevant.
17:23 stamourv: So I'm not sure what's going on.
17:23 (join) tilde`
17:26 (quit) Kaylin: Read error: Connection reset by peer
17:27 (join) Kaylin
17:28 (join) soegaard
17:33 (join) dca
17:36 (quit) mye: Ping timeout: 252 seconds
17:36 (quit) mizu_no_oto: Ping timeout: 240 seconds
17:50 (join) mithos28
18:03 (quit) myx: Ping timeout: 250 seconds
18:05 (join) luft
18:05 luft: hi
18:05 samth: hi
18:05 luft: I'm trying to execute a modular acl2 script with racket
18:05 luft: it works fine with drracket, but running racket -r scriptName.lisp doesn't do anything
18:07 (quit) Kaylin: Read error: Connection reset by peer
18:08 (join) Kaylin
18:08 dyoo: luft: checking...
18:08 (join) sirdancealot7
18:09 (join) luft_
18:09 luft_: sorry about that
18:09 dyoo: Does the very top of the program have the lang line "#lang planet cce/dracula"
18:09 dyoo: If so, you should just be able to do: "racket scriptName.lisp" without the '-r' options
18:09 luft_: #reader(planet "reader.rkt" ("cce" "dracula.plt") "modular" "lang")
18:10 dyoo: yeah, that looks about right. Try just running it with racket, no other command line options other than the filename
18:10 (quit) Kaylin: Read error: Connection reset by peer
18:10 (quit) luft: Ping timeout: 252 seconds
18:10 luft_: maybe it's to do with my expectations of what the script should do
18:10 luft_: hold on
18:12 (join) RacketCommitBot
18:12 RacketCommitBot: [racket] plt pushed 1 new commit to master: http://git.io/qjilBw
18:12 RacketCommitBot: racket/master cc8bd4f Vincent St-Amour: Make srclocs serializable.
18:12 (part) RacketCommitBot
18:14 (join) lewis1711
18:16 luft_: ok figured out what I was doing wrong
18:16 luft_: how do I load a file and then execute a function from the file?
18:17 dyoo: luft: not sure how modular ACL2 programs integrate with the rest of Racket's module system.
18:18 dyoo: luft: Regular Racket modules can be "required": http://docs.racket-lang.org/guide/module-basics.html
18:19 luft_: yeah, that's how the modular acl2 looks
18:19 luft_: http://pastebin.com/C0bKrVPp
18:20 luft_: I need to run a function named (stockAnalyzer ..)
18:20 dyoo: http://planet.racket-lang.org/package-source/cce/dracula.plt/8/10/planet-docs/guide/modular.html#(part._.Multiple_.Files)
18:20 dyoo: That looks relevant.
18:20 rudybot: http://tinyurl.com/a8gbrvm
18:20 dyoo: The last part in section 4.6.2, where they have a "run.lisp" program that requires the others, sounds like what you want.
18:21 (quit) francisl: Quit: francisl
18:21 dyoo: Afer writing run.lisp, just run it. :)
18:21 luft_: sort of
18:21 luft_: dyoo: I want to be able to change what inputs I use via command line
18:23 dyoo: testing...
18:23 luft_: got it I think
18:24 luft_: nope
18:24 luft_: tried racket -u rStockAnalyzer.lisp -e '(stockAnalyzer "hist.txt" "requests.txt" "out.html")'
18:24 dyoo: luft: I'm installing the package off of planet; taking a while...
18:28 dyoo: luft: darn. what I hoped would work didn't. You may need to check with cce to find out what's the right way to connect modular acl programs to the outside world.
18:28 (join) Nisstyre
18:29 luft_: damn
18:31 stamourv: luft_: He sometimes hangs around here as carleastlund.
18:31 stamourv: luft_: Have you tried `(enter! "rStockAnalyser.lisp")' from the REPL?
18:33 (quit) luft_: Ping timeout: 245 seconds
18:34 dyoo: stamourv: the problem is that the exports of anything written in modular acl2 all look like syntax bindings that can't be used in expression position
18:35 stamourv: Oh, that would be an issue.
18:35 dyoo: At least, that's what it looked like at first glance. Would have to get input from a modular acl2 user who knows what he's doing. That person is not me.
18:37 (quit) dyoo: Quit: dyoo
18:41 didi: What about this as a version of `se-path*/list' that discriminates each match?
18:45 didi: And the present functionality is only a `append*' away.
18:49 didi: Hum, suddenly I remembered the `match' thing. I don't know how to use it though.
18:51 (quit) mithos28: Quit: mithos28
18:53 (join) luft__
19:03 stamourv: jeapostrophe: DrDr looks borked.
19:06 (quit) jeapostrophe: Ping timeout: 252 seconds
19:06 (join) noelw
19:08 (quit) jrslepak: Quit: What happened to Systems A through E?
19:15 (join) PCChris_
19:17 (quit) sirdancealot7: Ping timeout: 240 seconds
19:18 (quit) PCChris: Ping timeout: 260 seconds
19:22 (join) jeapostrophe
19:22 (quit) jeapostrophe: Changing host
19:22 (join) jeapostrophe
19:25 (quit) PCChris_: Quit: Leaving
19:25 (quit) tilde`: Quit: kthxbai
19:39 (quit) jonrafkind: Ping timeout: 264 seconds
19:45 (join) sirdancealot7
19:48 (quit) sirdancealot7: Max SendQ exceeded
19:49 (join) sirdancealot7
19:49 (quit) soegaard: Quit: soegaard
19:58 (join) Kaylin
20:01 (join) mizu_no_oto
20:04 (quit) Kaylin: Read error: Connection reset by peer
20:04 (join) gridaphobe
20:04 (join) Kaylin
20:05 (join) gatlin_
20:10 (join) mithos28
20:11 (join) cdidd
20:16 (join) hash_table
20:17 (quit) spiderweb: Quit: ERC Version 5.3 (IRC client for Emacs)
20:20 (quit) nejucomo: Ping timeout: 276 seconds
20:22 (quit) luft__: Ping timeout: 255 seconds
20:25 (join) jrslepak
20:47 (join) didi
20:52 (quit) karswell: Read error: Connection reset by peer
20:52 (join) karswell
20:55 (quit) karswell: Read error: Connection reset by peer
20:55 (quit) hash_table: Ping timeout: 255 seconds
21:01 (quit) mithos28: Quit: mithos28
21:01 (quit) gridaphobe: Ping timeout: 255 seconds
21:02 (join) masm1
21:03 (quit) masm: Ping timeout: 252 seconds
21:11 (join) karswell
21:19 (join) sw2wolf
21:19 (quit) gatlin_: Ping timeout: 264 seconds
21:31 (join) francisl
21:45 (join) luft__
21:48 (quit) mizu_no_oto: Quit: Computer has gone to sleep.
21:50 (quit) bitonic: Ping timeout: 252 seconds
21:51 (join) kofno
21:51 lewis1711: is there anything that can generate unique integers in racket? like such that (unique-int) will never equal a subsequent call of (unique-int)
21:55 (join) francisl_
22:02 didi: rudybot: (define (make-unique-int) (let ((i 0)) (lambda () (set! i (+ i 1)) i)))
22:02 rudybot: didi: Done.
22:02 didi: rudybot: (define unique-int (make-unique-int))
22:02 rudybot: didi: Done.
22:02 didi: rudybot: (unique-int)
22:02 rudybot: didi: ; Value: 1
22:02 didi: rudybot: (unique-int)
22:02 rudybot: didi: ; Value: 2
22:02 didi: rudybot: (unique-int)
22:02 rudybot: didi: ; Value: 3
22:03 didi: lewis1711: ^
22:03 lewis1711: huh, i did not know you could do that. I wrote something similar in C once, but no idea how to do it in racket without the magic 'static' LOL. ty didi
22:04 didi: lewis1711: ;^)
22:04 didi: lewis1711: It's much better than `static' though.
22:04 didi: lewis1711: You can have an infinite number of `unique-int's.
22:04 didi: rudybot: (define unique-int-1 (make-unique-int))
22:04 rudybot: didi: Done.
22:05 didi: rudybot: (define unique-int-2 (make-unique-int))
22:05 rudybot: didi: Done.
22:05 didi: rudybot: (unique-int-1)
22:05 rudybot: didi: ; Value: 1
22:05 didi: rudybot: (unique-int-1)
22:05 rudybot: didi: ; Value: 2
22:05 didi: rudybot: (unique-int-1)
22:05 rudybot: didi: ; Value: 3
22:05 didi: rudybot: (unique-int-2)
22:05 rudybot: didi: ; Value: 1
22:06 lewis1711: that is pretty handy
22:06 lewis1711: ugh, i wish racket had dynamic vectors
22:07 didi: lewis1711: What do you mean?
22:08 lewis1711: vectors you can grow in place
22:08 didi: oic
22:10 asumu: lewis1711: do you know about the data/gvector library?
22:11 lewis1711: asumu: no! I was searching for "dynamic array" and "dynaic vectors". that's perfect
22:11 lewis1711: oh, I could implement a mutable stack with that too
22:12 lewis1711: http://docs.racket-lang.org/data/index.html?q=data&q=data/gvector&q=vector-append! how did I not know about this library
22:12 rudybot: http://tinyurl.com/as92fbz
22:16 (join) vu3rdd
22:16 (quit) vu3rdd: Changing host
22:16 (join) vu3rdd
22:22 didi: lewis1711: If you are starting to learn Racket, may I point out that it's an awesome language to use in a more functional way. So you could implement a stack with a list.
22:36 (quit) SamB: Ping timeout: 260 seconds
22:37 (join) SamB
22:44 (quit) masm1: Quit: Leaving.
22:45 (quit) nathanpc: Quit: Computer has gone to sleep.
22:51 (quit) Shviller: Ping timeout: 255 seconds
22:51 (join) Shviller
22:54 (quit) francisl_: Quit: francisl_
22:55 lewis1711: didi: yeah I read how to do that in okasaki I think, and *usually* yes immutable structures, recursion, functional updates. But the use case is - a 2d array of tiles in for a 2d grid based game. The number of tiles may be large and a functional update is not feasible. I will use mutable stacks to represent the occupants of a tile (so a tile may have an n items, a monster, etc). Though if you can think of a way to do this functionally I
22:55 (join) jonrafkind
22:57 (quit) jschuster: Quit: Coyote finally caught me
22:59 (join) jschuster
23:01 didi: lewis1711: Oh, you should obviously use the right tool to the job. But with some argument fiddling, you can use a 2d array with immutable stacks.
23:01 didi: s/to/for
23:01 didi: lewis1711: But only if it makes sense.
23:04 lewis1711: I could use immutable stacks, but then I still have to modify the "occupants" field of the tile struct where the stack would reside
23:04 lewis1711: so I'd just end up doing a nifty functional update then overwriting something anyway
23:12 (join) mizu_no_oto
23:16 (join) mithos28
23:19 didi: lewis1711: I see what you mean. Yes, if you use `vector', I agree.
23:21 (nick) luft__ -> luft
23:25 (quit) francisl: Quit: francisl
23:25 lewis1711: https://gist.github.com/4230734 that was difficult, time for a break
23:28 (join) francisl
23:43 (quit) kofno: Remote host closed the connection
23:59 (join) rck