00:22 (join) offby1` 00:26 (quit) offby1: Ping timeout: 276 seconds 00:44 (join) offby1`` 00:46 (quit) chandler: Ping timeout: 276 seconds 00:46 (join) chandler 00:46 (nick) chandler -> Guest92500 00:48 (quit) offby1`: Ping timeout: 272 seconds 01:26 (quit) danbrown: Remote host closed the connection 01:44 (quit) jonrafkind: Ping timeout: 264 seconds 02:55 (quit) writer: Quit: writer 03:53 (quit) lisppaste: Ping timeout: 255 seconds 04:27 (nick) Lajla -> Lajla_of_Arabia 04:31 (nick) Lajla_of_Arabia -> Lajla 05:18 (quit) jao: Ping timeout: 255 seconds 05:54 (quit) Lajla: Ping timeout: 250 seconds 06:09 (join) jao 06:20 (join) Lajla 06:21 (join) scifi 06:21 scifi: hey , well can someone tell me the defenition of filter 06:21 scifi: #definition 06:22 scifi: i know its something like (define (filter procedure lst)) 06:22 scifi: (cond ((null? lst) 06:22 scifi: #f 06:22 scifi: ((procedure (car lst)) #t) 06:22 scifi: (else (filter procedure 8cdr lst))))) 06:51 (join) emma 06:56 scifi: but cant seam to get it rigth 07:08 (quit) vu3rdd: Quit: ERC Version 5.3 (IRC client for Emacs) 07:10 rapacity: http://pastey.net/142941 07:14 scifi: ty 07:14 scifi: thanks 07:20 scifi: you even seperated lambda 07:20 scifi: from let 07:20 scifi: thanks 07:54 (quit) Guest92500: Changing host 07:54 (join) Guest92500 07:54 (nick) Guest92500 -> chandler 08:21 (join) MayDaniel 08:25 (join) mceier 08:29 (join) b-man_ 08:31 (join) writer 08:35 (quit) MayDaniel: 09:11 (quit) scifi: Ping timeout: 265 seconds 09:17 (quit) mceier: Quit: leaving 09:35 (join) racklet 09:37 racklet: Is it possible to get the custodian of an evaluator in order to (current-memory-use )? 10:10 samth: racklet, you should be able to do (the-evaluator '(current-memory-use (current-custodian))) 10:12 racklet: I tried that but it always returns 0 10:12 samth: ah 10:12 samth: eli is the right person to ask about that, i don't know if he's around 10:12 samth: alternatively, you could ask on the racket mailing list 10:13 racklet: thank you. I'll hang around a bit more, it's not that critical, I just wondered... :) 10:27 (join) danbrown 10:38 (join) MayDaniel 10:49 (nick) offby1`` -> offby1 10:50 (quit) offby1: Changing host 10:50 (join) offby1 10:57 (join) vu3rdd 11:04 eli: racklet: See `call-in-sandbox-context'. 11:06 (join) MayDaniel_ 11:10 (quit) MayDaniel: Ping timeout: 264 seconds 11:11 racklet: eli: (call-in-sandbox-context evaluator (λ () (current-memory-use (current-custodian)))) ==> 0 11:12 racklet: the evaluator was created with (make-evaluator 'r5rs) 11:13 racklet: actually (call-in-sandbox-context (make-evaluator 'r5rs) (λ () (current-memory-use (current-custodian)))) returns 0, too 11:19 eli: racklet: weird, I have to run now, so I'll try more stuff later. 11:19 racklet: ok, thank you 11:20 (join) pygospa 11:21 (quit) danbrown: Remote host closed the connection 11:22 (join) danbrown 11:23 (quit) TheRealPygo: Ping timeout: 276 seconds 11:36 (join) sstrickl 11:55 (join) carleastlund 11:57 (join) anRch 12:08 (join) Fare 12:11 (quit) jao: Ping timeout: 265 seconds 12:25 (join) jonrafkind 12:28 (quit) danbrown: Remote host closed the connection 12:29 jonrafkind: do modules get instantiated once for each phase and each namespace? 12:30 samth: i'm confused by your question 12:30 samth: evaluation happens in a given namespace 12:31 samth: i recommend reading YWIW and/or AMATITS for the details 12:31 samth: or asking ryan 12:31 jonrafkind: if you require x.rkt, then parameterize the current namespace and do (dynamic-require x.rkt), does x.rkt get instantiated twice? 12:31 jonrafkind: ryan's not around 12:31 jonrafkind: i could ask matthew though 12:32 samth: yes, those two namespaces have nothing to do with each other 12:32 jonrafkind: whats amatits 12:32 samth: actually, parameterize the current namespace to what? 12:32 samth: advanced macrology and the implementation of typed scheme 12:32 samth: sorry, it should be AMatIoTS 12:32 samth: forgot the O 12:32 jonrafkind: make-base-empty-namespace 12:32 samth: then yes, those namespaces have nothing to do with each other 12:33 jonrafkind: ok so yes to my original question 12:33 jeapostrophe: the web-server does this to separate servlets from each other and the server 12:33 jonrafkind: i have some code that im calling expand-syntax on which puts some values into phase 1 and I want to get those values back out 12:34 jonrafkind: so I did (expand-syntax #'(get-foo)) but it gets 0 back basically 12:34 jonrafkind: so I thought the original expand-syntax was occuring in a different namespace 12:36 jonrafkind: is it possible to get a handle on the namespace the original syntax was using? 12:38 jeapostrophe: could you have the macro record it in a syntax-property that you pull out later? 12:39 jonrafkind: hm, i dont see an easy way of doing that.. 12:39 jeapostrophe: what is current-namespace when the macro is expanding? 12:41 jonrafkind: i dunno, but im expanding a (module ...) form, does that create a new namespace? 12:41 samth: no 12:42 samth: if you are calling expand, you should do it in a namespace that you explicitly create 12:42 samth: the default namespace is never useful 12:42 jonrafkind: im hacking the errortrace code so I didn't write this part 12:42 jonrafkind: but i guess i can make a new namespace here 12:44 samth: tewk, ping 12:44 (quit) tv|z: Ping timeout: 255 seconds 12:45 (quit) b-man_: Remote host closed the connection 12:46 (join) tv|z 12:56 tewk: samth: yes 12:59 (quit) MayDaniel_: 13:04 (quit) anRch: Quit: anRch 13:10 samth: tewk, 2 things 13:10 samth: 1. you probably could avoid compiling mred etc in the pre-compilation phase 13:11 samth: 2. it seems like lots of memory gets leaked during building - as in, it eventually starts swapping heavily 13:19 jeapostrophe: samth: pldi isn't supposed to be one column, right? 13:19 jeapostrophe: you just added the option? 13:23 samth: jeapostrophe, that just hides the second column, for easier editing 13:23 jeapostrophe: ah 13:23 jeapostrophe: neat 13:23 samth: pldi is the standard sigplan format 13:23 samth: it's from matthias 13:24 jeapostrophe: what do you mean "it's from matthias"? he wanted to edit it with one column? 13:33 samth: yes, and he provided me w/ the sigplanconf.cls file that supports it 13:35 jeapostrophe: cormac uses that too now that i think of it 13:40 (join) anRch 14:03 (join) MayDaniel 14:06 (join) mceier 14:22 eli: racklet: ping 14:23 jeapostrophe: who are racklets? 14:23 jeapostrophe: am i one? 14:24 eli: Calling someone who used it as a nickname. 14:24 jeapostrophe: that would be a funny nickname for a racketeer 14:25 jonrafkind: im getting arackniphobia 14:26 (quit) MayDaniel: 14:26 jonrafkind: so before I do the call to `expand-syntax' I print the current namespace and see # 14:27 jonrafkind: in the code that gets expanded I have another print to the current namespace and see # 14:27 jonrafkind: so those are completely different right? 14:27 jonrafkind: i tried setting up my own namespace and parameterizing it but got some error about 'link module mismatch' 15:06 (quit) Lajla: Read error: Connection reset by peer 15:07 (join) Lajla 15:08 (join) _ryanc_ 15:10 samth: _ryanc_, ping 15:10 _ryanc_: samth, pong 15:11 samth: i can't reach thistle 15:12 _ryanc_: ah, try port 8000, sorry 15:13 samth: so you're looking at .zo files, which is one difference 15:13 samth: i think 15:13 _ryanc_: no, I'm looking at the source, calling 'read', checking to make sure it starts (module ...), and looking at the language position 15:14 samth: then how are you getting a high count for the lang I mentioned, which only occurs once in the source tree? 15:17 _ryanc_: eg, scheme/list uses "#lang scheme/private/provider", which uses the reader at scheme/private/provider/lang/reader, which inserts scheme/private/provider/lang as the module language 15:18 samth: ah, i understand now 15:18 _ryanc_: it's just a question of pre-read or post-read 15:20 samth: makes sense 15:20 samth: is there a reason to prefer one to the other? 15:24 _ryanc_: I think the post-read notion of language is more related to the notion of macros, whole-module analysis and transformation, etc, whereas the pre-read notion is more about reader extensions. 15:35 (quit) anRch: Quit: anRch 15:42 jeapostrophe: eli: i thought you said i could pass pointers through the ffi with _intptr? 15:43 jeapostrophe: scheme->c rejects them 15:43 (join) b-man_ 15:56 eli: jeapostrophe: ? 15:56 jeapostrophe: If i have an ffi that takes an _intptr argument 15:56 jeapostrophe: I cannot pass it a _pointer or _cpointer object, I can only pass numbers 15:56 jeapostrophe: Defeating the whole point of _intptr 15:57 eli: Yes, the code is bogus. 15:58 jeapostrophe: Then why did you close the pr? 15:58 eli: Actually, it's not. 15:58 jeapostrophe: Actually maybe there never was one 15:58 eli: (I don't remember a pr about it.) 15:58 jeapostrophe: So, can I have that? 15:59 eli: It's an integer representation of the corresponding size of a point. 15:59 eli: Why do you need it? 15:59 eli: If you need to pass a pointer, then why not use a real pointer? 16:00 jeapostrophe: for opencl 16:00 eli: more specific? 16:00 jeapostrophe: it has a function that requires a vector of _intptrs which is basically an alist of LABEL: PTR ... 16:00 jeapostrophe: the label is a number (4228) 16:00 jeapostrophe: and the ptr is a real pointer 16:01 eli: So why not use a vector of `_pointer's? 16:02 jeapostrophe: because i can't turn 4228 into a pointer either 16:03 eli: I'm not following that. 16:03 eli: If the label is a number, then why do you need to convert it to a pointer? 16:03 jeapostrophe: (vector 4228 some-pointer 0) is what the function wants 16:04 jeapostrophe: (_vector i _intptr) is the type 16:04 jeapostrophe: but some-pointer is not an _intptr 16:04 jeapostrophe: if i changed _intptr to _pointer, then 4228 and 0 are not _pointers 16:04 jeapostrophe: this is why _intptr exists 16:04 eli: Then the (_vector i _intptr) is wrong 16:04 jeapostrophe: our ffi cannot handle it 16:04 jeapostrophe: what do you mean? 16:04 eli: (It can, but in an inconvenient way.) 16:05 eli: The `_intptr' thing corresponds to `intptr_t' -- it's an integer that is the size of a pointer. 16:05 eli: It's not intended to be used as a pointer. 16:06 jeapostrophe: real C code uses _intptr as a thing to cast pointers to when they want to treat them as numbers 16:06 jeapostrophe: but not lose bits 16:06 jeapostrophe: our _intptr can't do that 16:07 eli: Yeah, but the typecasting is not something that we need, since you can just use a _pointer 16:08 jeapostrophe: but i can't because i can't turn 4228 into a pointer 16:08 jeapostrophe: because we don't allow that either 16:08 eli: You said that you have (vector 4228 some-pointer 0), and that only the middle one is a pointer, so why do you need to convert the first thing into one? 16:09 jeapostrophe: because it is one argument (_vector i _intptr) 16:09 jeapostrophe: not three arguments with three different types 16:10 eli: Go back to the vector -- if it's a number, a pointer, and a number, then you should use a struct of the three. 16:10 jeapostrophe: the spec defines it as void fun (_intptr* this_thing) 16:10 jeapostrophe: that is just one allowable use case 16:10 jeapostrophe: it can be any 2n+1 vector 16:10 jeapostrophe: you have a label (some number) then a pointer, repeated 16:10 jeapostrophe: then 0 16:12 eli: So their only use for `intptr_t' is to treat the labels as numbers? 16:12 jeapostrophe: ya, they have a whole bunch of #defines for all the labels that you can use --- plus there is the final 0 number 16:13 eli: In this case it sounds like using `_pointer's is the right thing. 16:13 eli: For the last 0, you can just use NULL aka #f. 16:14 eli: And if there's a given set of labels, then translate them from numbers to `_pointer's too. 16:14 jeapostrophe: how do i get 4228 as a pointer? 16:14 eli: That's the awkward thing that I mentioned -- but it's not too bad if you need to do it only when initializing the code. 16:15 jeapostrophe: i don't understand 16:15 jeapostrophe: afaict there is no function number->pointer 16:15 eli: Give me a second, and I'll show you 16:15 jeapostrophe: okay 16:17 eli: (define (integer->pointer n) (let ([p (malloc _pointer)]) (ptr-set! p _intptr 0 n) (ptr-ref p _pointer))) 16:17 eli: Something like that should work. 16:17 jeapostrophe: this should be a feature of the ffi and _intptr should work as in c 16:19 eli: You don't want what C does -- this means that you'd be able to pass any fixnum as a pointer. 16:19 jeapostrophe: I want _intptr to take numbers and pointers 16:20 eli: Then it's not _intptr that you want, it's something different. 16:22 eli: OK, there was a PR. 16:22 eli: The PR asked for a type for `intptr_t', which is what I implemented. 16:22 jeapostrophe: Okay, in C you cast from some pointer type to _intptr 16:22 jeapostrophe: So if we had pointer->integer that would be fine 16:22 eli: Having a pointer type that can be used as a number is different. 16:23 jeapostrophe: Your position is pedantically ignoring what _intptr is for 16:23 eli: Not at all. 16:23 eli: My position is wrt to `intptr_t' -- which is an *integer*. 16:24 eli: You're now asking for something *different*. 16:24 eli: And it's not clear to me what exactly it is that you want. 16:25 jeapostrophe: I want to write this function and have it work the way it works in C 16:25 jeapostrophe: _intptr_t is defined the way it is so functions can treat numbers and pointers uniformly 16:25 eli: One option, which is clearly bad, is to do *exactly* what C does, and make integers be valid values for pointers. 16:26 jeapostrophe: You have defined an _intptr the same way as _intptr_t without allowing it to treat numbers and pointers uniformly 16:26 jeapostrophe: Let me try it this way: 16:26 jeapostrophe: I want a type, _x 16:26 jeapostrophe: where 4228 is a valid racket value for type _x 16:26 jeapostrophe: and where (malloc ...) is a valid racket value for type _x [for some ...] 16:27 jeapostrophe: I contend that _x = _intptr, you do not. If that is the case, give it to me by another name 16:27 jeapostrophe: When an _x comes FROM C code, I always want the integer representation (4228) not something that is a pointer 16:28 jeapostrophe: But it would be nice to be allowed to get the pointer version, but I don't need it in this FFI 16:28 eli: That's just an arbitrary point that is specific to that library. 16:29 jeapostrophe: What's an arbitrary point? 16:29 eli: The fact that you want the integer when a value is coming from C. 16:30 jeapostrophe: Yes (in fact the library never returns these things) 16:31 eli: IIUC, the cleanest addition that would satisfy you would be a primitive way to translate a pointer to a number. 16:31 eli: Or maybe a number to a pointer. 16:31 eli: Then it would be easy to make up your own ctype using this. 16:31 eli: Does this sound right? 16:32 eli: ...and when you make up that ctype, you decide whether the base ctype is a _pointer or a number -- and in the latter case you'd use `_intptr'. 16:32 eli: Does this sound right? 16:32 jeapostrophe: Yes, but I think this should be built in because it is common 16:33 eli: Whether it is is a different question, 16:33 eli: the common thing that this resolves for now is the ability to "typecast" back and forth between the two. 16:34 eli: That is, all cases of `(long)ptr' or `(void*)num'. 16:34 jeapostrophe: yes 16:34 eli: What you want to build on top of this is some `_int_or_ptr' thing, 16:34 eli: which would accept either one, 16:35 eli: and the question is what is the base ctype that is used in that definition, 16:35 eli: and this is why I hesitate to provide one from the ffi at this point. 16:36 eli: Perhaps a sane implementation of such an addition is a ctype that is based on *either* one in a way that you don't care about: 16:36 eli: by just making it throw an error in case it's being used as a result value. 16:36 eli: (In the c->s direction.) 16:36 eli: OK, how about this: 16:37 eli: 1. Add `integer->pointer' and `pointer->integer'. 16:37 eli: 2. Implement `_int_or_ptr' as I described above -- using it as a type works when sending values to C, but throws an error getting back. 16:38 jeapostrophe: I like it 16:38 eli: 3. Make it have an optional base ctype, so you could get the other two behaviors with (_int_or_ptr _pointer) and (_int_or_ptr _intptr). 16:39 eli: This way -- IIUC -- you won't need to do anything, since you'll just use the default `_int_or_ptr', given that it's not used as an output value, right? 16:41 eli: jeapostrophe: ? 16:41 jeapostrophe: yes 16:41 jeapostrophe: i like it 16:41 eli: OK. 16:41 jeapostrophe: thanks eli 16:42 eli: I'll send out an email to Matthew too, since he might have ran into it. 17:14 (quit) b-man_: Remote host closed the connection 17:27 (join) jao 18:01 (quit) hanDerPeder: Quit: hanDerPeder 18:04 (join) writer_ 18:05 (quit) writer: Ping timeout: 240 seconds 18:05 (nick) writer_ -> writer 18:05 (quit) writer: Changing host 18:05 (join) writer 18:05 (join) hanDerPeder 18:09 (quit) hanDerPeder: Client Quit 18:16 (join) hanDerPeder 18:19 (quit) _ryanc_: Quit: Leaving 18:39 (quit) jao: Remote host closed the connection 18:59 (quit) Fare: Quit: Leaving 19:38 (quit) carleastlund: Quit: carleastlund 19:38 (quit) sstrickl: Quit: sstrickl 20:05 (quit) mceier: Quit: leaving 20:09 (join) b-man_ 20:26 (quit) jonrafkind: Ping timeout: 255 seconds 20:40 (quit) pygospa: Disconnected by services 20:40 (join) TheRealPygo 21:37 (join) samth_ 21:48 (quit) b-man_: Remote host closed the connection 23:07 (quit) samth_: Quit: Ex-Chat 23:47 (quit) Lajla: Read error: Connection reset by peer 23:48 (join) Lajla 23:55 (join) jonrafkind