Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-22 Thread Thomas Dickerson
I seem to be missing some key ingredient here. The following really simply test-case, using let-syntaxes, works as expected: > (define-syntax my-def-stx > (lambda (stx) > (syntax-case stx (my-def-stx) > [(my-def-stx (id ...) rhs expr) >#'(let-syntaxes ([(id ...) rhs]) expr)])))

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-22 Thread Matthew Flatt
Probably you don't want to work with namespaces, which are intended more for run-time reflection. For an example of turning internal definitions into 'letrec-syntaxes+values', try the implementation of 'racket/block'. > On Jun 23, 2015, at 10:06 AM, Thomas Dickerson > wrote: > > Update / add

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-22 Thread Thomas Dickerson
Update / addendum: I was also able to fairly trivially extend Alex's code using let-syntax to have the more hygienic behavior for where Accum is/is-not visible, but let-syntax ends up leaving an additional layer of empty (let-values() ...) behind. The documentation for let-syntax makes the foll

Re: [racket-users] drawing with canvas

2015-06-22 Thread Matthew Flatt
The docs here might help elaborate on Matthias's answer: http://docs.racket-lang.org/gui/canvas___.html I'll try adding more links to that information, including from the `get-dc` method. Maybe it also would be better as its own section in the overview chapter. At Mon, 22 Jun 2015 18:07:04 -04

Re: [racket-users] drawing with canvas

2015-06-22 Thread Matthias Felleisen
[[ I am tempted to say that you misplaced the parentheses and brackets and broke lines at the wrong place. ]] Here is a re-ordering of the first "don't work" variant that kind of works: #lang racket (require slideshow racket/class racket/gui/base) (define my-frame (new frame% [label

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-22 Thread Thomas Dickerson
Thanks for the effort that went into figuring that out! A couple first thoughts on the implementation: To first order, this is exactly what I want to be able to do (and it elegantly avoids local-expand by reasoning about expansion order); however, as a general pattern, it's a bit unhygienic in t

Re: [racket-users] Re: Fast way to map over a list many times, changing ONE element each time?

2015-06-22 Thread Jens Axel Søgaard
Hi Luke, With 5000 numbers I got the numbers below with a slightly modified benchmark. If one method generates garbage and triggers a garbage collection while running the following method, then the numbers will be unfair. To avoid this I call collect-garbage before calling time. map-once method n

[racket-users] drawing with canvas

2015-06-22 Thread Mianlai Zhou
Hi people, I am wondering why this segment of code failed to work: ; don't work #lang racket (require slideshow racket/class racket/gui/base) (define my-frame (new frame% [label "my frame"] [width 300] [height 300] [alignment '(center ce

[racket-users] Molis Hai -- passwords generated from Dickens

2015-06-22 Thread 'John Clements' via users-redirect
About six months ago, I had an idea on how to generate passwords from English text while still maintaining entropy. I wrote it up quickly on ArXiv, and published a web page where you can try it: http://www.brinckerhoff.org/molis-hai/ I’ve now released it as a raco command-line tool, too. You ca

[racket-users] NEED || Sr. Oracle Functional Consultant || Billerica, MA

2015-06-22 Thread Aanchal Arora
Hi, This is Aanchal from Technology resource Group. Below is the job description and requirements for your perusal and please contact me if having any questions or concerns. *OPENINGS: 2* *Role: Sr. Oracle Functional Consultant* *Location: Billerica, MA* *Duration: 6 Months (Extension possi

[racket-users] Re: HTTP Cookies

2015-06-22 Thread Bahman Movaqar
Sorry for the lame subject; that was the draft subject and I forgot to changing it before posting. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+

[racket-users] HTTP Cookies

2015-06-22 Thread Bahman Movaqar
TLDR; How to store use HTTP cookies across multiple requests in an HTTP client? I'm trying to fetch a URL and, say, print the cookies it sets. Fetching a URL is easily done with `call/input-url`, however it doesn't handle HTTP response headers (incl. cookies). There are `http-conn-open`, `ht

Re: [racket-users] Closing big-bang windows

2015-06-22 Thread Matthias Felleisen
On Jun 22, 2015, at 11:31 AM, Jens Axel Søgaard wrote: > John Carmack: > My son's game has a level editor as well as a game loop, and we switch > between them. However, each new big-bang call creates a new window, leaving > the previous ones inert on the screen. How can we close the windows

Re: [racket-users] no plot zooming on local build--update procedure wrong?

2015-06-22 Thread Robby Findler
Yes, sorry about that everyone. Poor planning on my part. Robby On Monday, June 22, 2015, Neil Toronto wrote: > Robby has just pushed an evil hack that makes plots and pict3ds > interactive again. > > In the future, there will be a transition to a different "interactive > values" API, but it'll

Re: [racket-users] no plot zooming on local build--update procedure wrong?

2015-06-22 Thread Neil Toronto
Robby has just pushed an evil hack that makes plots and pict3ds interactive again. In the future, there will be a transition to a different "interactive values" API, but it'll go a lot smoother. Neil ⊥ On 06/21/2015 12:34 PM, Neil Toronto wrote: It's because of this: https://groups.google.

Re: [racket-users] Re: Converting a heterogenous list into a string

2015-06-22 Thread Bahman Movaqar
On Monday, 22 June 2015 16:46:39 UTC+4:30, Daniel Prager wrote: > (apply ~a >      (map (λ (x) (apply format "[~a=~a]" x)) paired-list)) I like it! I had totally forgotten about `apply`. > BTW: In DrRacket you can get the λ by using Cmd+\ (on Mac, shortcut listed in > the Insert file menu). T

Re: [racket-users] try a new macro expander

2015-06-22 Thread Matthew Flatt
At Thu, 21 May 2015 07:15:14 -0600, Matthew Flatt wrote: > Otherwise, be prepared for me to come back in a few > weeks and lobby for moving to a new macro expander. Here's the proposal: let's switch on July 16. "Switch" means that I'd merge the new macro expander to the master branch of the develo

Re: [racket-users] Re: Converting a heterogenous list into a string

2015-06-22 Thread Daniel Prager
I reckon, rather than using match or first & second (apply ~a (map (λ (x) (apply format "[~a=~a]" x)) paired-list)) is quite neat. BTW: In DrRacket you can get the λ by using Cmd+\ (on Mac, shortcut listed in the Insert file menu). Dan -- You received this message because you are subscr

Re: [racket-users] Re: Defining contracts sanely

2015-06-22 Thread Robby Findler
On Mon, Jun 22, 2015 at 2:43 AM, Aidan Gauland wrote: >> If this does what you want, it’s fine, but the define/contract is probably >> unnecessary, and >> (define fish-freshness/c >> (flat-named-contract ‘fish-freshness/c >> (lambda (x) >> (not (eq? ….) >> Should do what you want.

Re: [racket-users] Closing big-bang windows

2015-06-22 Thread Jay McCarthy
On Sun, Jun 21, 2015 at 10:18 PM, Neil Toronto wrote: > On 06/21/2015 02:54 PM, Alexis King wrote: >>> >>> I guess I could add a close-on-stop clauses for programmers >>> such as your son but it sounds almost like he's ready to move >>> on to racket proper, as in use the Windowing API directly. >>

[racket-users] Re: Converting a heterogenous list into a string

2015-06-22 Thread Bahman Movaqar
On Monday, 22 June 2015 02:34:43 UTC+4:30, Bahman Movaqar wrote: > Assuming > > (define my-list ("a" 1 "b" 2.5 "c" #t "d" "hi")) > > what is the idiomatic way to convert `my-list` into the following? > > "[a=1][b=2.5][c=#t][d=hi]" Thank you Jon, Robby and Matthias for the help. The

Re: [racket-users] db: nested transactions

2015-06-22 Thread Michael Titke
On 22/06/2015 11:05, George Neuner wrote: Hi all, I have what I hope is a quick question. WIth appropriate care to pair start and commit/rollback, is it safe to use call-with-transaction and start-transaction together? e.g., (call-with-transaction dbc (lambda () : (st

[racket-users] db: nested transactions

2015-06-22 Thread George Neuner
Hi all, I have what I hope is a quick question. WIth appropriate care to pair start and commit/rollback, is it safe to use call-with-transaction and start-transaction together? e.g., (call-with-transaction dbc (lambda () : (start-transaction dbc #:isolation 'serializab

[racket-users] Re: Defining contracts sanely

2015-06-22 Thread Aidan Gauland
On 22/06/15 04:26, Alexander D. Knauth wrote: > > On Jun 21, 2015, at 5:41 AM, Aidan Gauland wrote: > >> Say I want to define a flat contract for the "freshness" field of my >> fish class, so I define a contract for it like so: >> >> (define/contract fish-freshness/c >> (-> any/c >> boolean