[racket-users] define-syntax question

2017-03-13 Thread NeverTooOldToCode
>From Greg Hendershott's Fear of Macros, section 3.3: > (define-syntax (show-me stx) (print stx) #'(void)) > (show-me '(+ 1 2)) # Why does the syntax object stx include "show-me"? Intuitively I would expect just the syntax object representing '(+ 1 2) -- You received this message

Re: [racket-users] define-syntax question

2017-03-13 Thread NeverTooOldToCode
On Monday, March 13, 2017 at 1:35:12 PM UTC+1, Matthias Felleisen wrote: > > On Mar 13, 2017, at 7:06 AM, NeverTooOldToCode wrote: > > > > From Greg Hendershott's Fear of Macros, section 3.3: > > > >> (define-syntax (show-me stx) > >(print stx) > >#'(void)) > >> (show-me '(+ 1 2)) > > >

Re: [racket-users] define-syntax question

2017-03-13 Thread Matthias Felleisen
> On Mar 13, 2017, at 7:06 AM, NeverTooOldToCode wrote: > > From Greg Hendershott's Fear of Macros, section 3.3: > >> (define-syntax (show-me stx) >(print stx) >#'(void)) >> (show-me '(+ 1 2)) > > # > > Why does the syntax object stx include "show-me"?

[racket-users] linking with raco ctool : unable to find libracket3mxxxxxxx.lib

2017-03-13 Thread Carlos Lopez
Hi, I'm compiling portaudio's callbacks.dll to have it with debug symbols but I'm running into a configuration issue. when running raco ctool --ld ... I get the message that libracket3mxxx.lib is not found. I tried running racket -l setup/winvers but did not see any change. what would be

[racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread David Storrs
I've got a centralized database connector: (define dbh (virtual-connection (connection-pool (thunk (postgresl-connect ...) This gets passed around from handle to handle and into various temporary or ongoing worker threads. Thinking about it, I'd

[racket-users] refactoring help/tools?

2017-03-13 Thread Dan Liebgold
Hi - In refactoring a some Racket code I'd love to have a "require and provide only what you need" tool to help trim down the require and provide lists. Is there such a thing? Or at least a better approach for this than inspection or trial and error? Thanks, Dna -- You received this message

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Jay McCarthy
racket-mode in Emacs does this Jay On Mon, Mar 13, 2017 at 1:17 PM Dan Liebgold wrote: > Hi - > > In refactoring a some Racket code I'd love to have a "require and provide > only what you need" tool to help trim down the require and provide lists. > Is there such a

Re: [racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread George Neuner
On 3/13/2017 5:16 PM, Ryan Culpepper wrote: When a thread uses a VC, it gets an underlying connection assigned exclusively to it for the lifetime of the thread[*]. When the thread dies, the VC releases the underlying connection; if it came from a pool, it returns to the pool and it can be

[racket-users] prepared queries

2017-03-13 Thread George Neuner
Hi Ryan, On 3/13/2017 5:43 PM, Ryan Culpepper wrote: Racket's db library always prepares a statement before executing it, even if there are no query parameters. When allowed, instead of closing the prepared statement immediately after executing it, the connection stores it in a

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Matthias Felleisen
> On Mar 13, 2017, at 5:26 PM, Stephen De Gabrielle > wrote: > > Do you mean a drracket plugin that > i. Expands #lang racket into racket/base and requires, > ii. removes the unneeded requires I am sure that one day soon someone will write a dissertation that (1)

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Philip McGrath
raco check-requires might do some of what you want. -Philip On Mon, Mar 13, 2017 at 12:18 PM, Jay McCarthy wrote: > racket-mode in Emacs does this > > Jay > > On Mon, Mar 13, 2017 at 1:17 PM Dan Liebgold > wrote: > >> Hi - >> >> In

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Jay McCarthy
M-x racket-tidy-requires Jay On Mon, Mar 13, 2017 at 1:29 PM Matthias Felleisen wrote: > > Does Emacs really give you this refactoring? If so, I may have to > reconsider DrRacket. > > > > On Mar 13, 2017, at 1:18 PM, Jay McCarthy > wrote: > > > >

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Matthias Felleisen
I know that one. I want the refactoring. > On Mar 13, 2017, at 1:40 PM, Robby Findler > wrote: > > Not the same thing, but if you mouse over the requires in DrRacket, it > will put a red background on the ones that have no apparent use (of > course, requires may

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Robby Findler
Not the same thing, but if you mouse over the requires in DrRacket, it will put a red background on the ones that have no apparent use (of course, requires may have an effect too; neither tool picks that up, IIUC). Robby On Mon, Mar 13, 2017 at 12:38 PM, Jay McCarthy

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Matthias Felleisen
Does Emacs really give you this refactoring? If so, I may have to reconsider DrRacket. > On Mar 13, 2017, at 1:18 PM, Jay McCarthy wrote: > > racket-mode in Emacs does this > > Jay > > On Mon, Mar 13, 2017 at 1:17 PM Dan Liebgold >

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Dan Liebgold
On Monday, March 13, 2017 at 10:40:15 AM UTC-7, Robby Findler wrote: > Not the same thing, but if you mouse over the requires in DrRacket, it > will put a red background on the ones that have no apparent use (of > course, requires may have an effect too; neither tool picks that up, > IIUC). >

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Robby Findler
The bubble in the bottom right corner turns green when it is done (or red, if it found an error). Robby On Mon, Mar 13, 2017 at 12:52 PM, Dan Liebgold wrote: > On Monday, March 13, 2017 at 10:40:15 AM UTC-7, Robby Findler wrote: >> Not the same thing, but if you

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Jay McCarthy
Actually it is the trim option. I prefer racket-base-requires though Jay On Mon, Mar 13, 2017 at 1:37 PM Jay McCarthy wrote: > M-x racket-tidy-requires > > Jay > > On Mon, Mar 13, 2017 at 1:29 PM Matthias Felleisen > wrote: > > > Does Emacs really

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Dan Liebgold
raco check-requires does the job. I use emacs racket-mode, but it's hobbled in ways I haven't investigated -- e.g. when I try to use tidy or trim requires it gives me a "Can't do, source file has error" when it doesn't, or at least not in a way I can see. -- You received this message because

Re: [racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread Ryan Culpepper
On 03/13/2017 12:49 PM, David Storrs wrote: [...] Assuming I've understood all that correctly, my last question would be how to get around the 'can't do prepare with a virtual connection' issue for situations where I've been passed a connection (perhaps from third party code) and it might or

Re: [racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread George Neuner
Hi David, On 3/13/2017 12:49 PM, David Storrs wrote: I've got a centralized database connector: (define dbh (virtual-connection (connection-pool (thunk (postgresl-connect ...) This gets passed around from handle to handle and into various temporary or

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Greg Hendershott
The `racket-trim-requires` and `racket-base-requires` commands use `raco check-requires` behind the scenes (then format/sort as does `racket-tidy-requires`). Today I tried to use `racket-trim-requires` on a Typed Racket file containing `define-type`; and got the error you mention. This turned out

[racket-users] Re: prepared queries

2017-03-13 Thread Ryan Culpepper
On 03/13/2017 06:30 PM, George Neuner wrote: Hi Ryan, On 3/13/2017 5:43 PM, Ryan Culpepper wrote: Racket's db library always prepares a statement before executing it, even if there are no query parameters. When allowed, instead of closing the prepared statement immediately after executing it,

[racket-users] Why does 1 count as numeric in xexpr, but 0 does not?

2017-03-13 Thread Marc Kaufmann
Hi, I am creating matrices of 0s and 1s that I display in HTML-tables and somewhat surprisingly I found out that 0s are not permissible in X-expressions, while 1s are: (require web-server/http) (response/xexpr '(html 1)) ; Fine, no trouble. (response/xexpr '(html 0)) ; Blow-up. The specific

Re: [racket-users] Why does 1 count as numeric in xexpr, but 0 does not?

2017-03-13 Thread Philip McGrath
Numbers in x-expressions are interpreted as XML entities, not as the string representation of the number. The value of (xexpr->string '(html 1)), to use your example, is "". The 1 represents the character that Racket would represent as #\u0001, i.e. the value of (integer->char 1). In contrast,

[racket-users] Require the same file repeatedly for debugging on command line

2017-03-13 Thread Marc Kaufmann
Hi all, while trying to debug, I often change the code in the text file and then want to do a (require "file-with-code.rkt") on the command line to test the new code. This never works, because I cannot redefine imported modules. Thus I always use Dr Racket for this, where I can hit the "Run"

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Daniel Feltey
I've started working on adding this refactoring to DrRacket[1], it's not quite as full-featured(and is definitely still a bit buggy) as what racket-mode in emacs seems to allow, but it's a first step and I'd appreciate suggestions or requests on how DrRacket can better support developers editing

[racket-users] SUBJECT: ACM/SPEC ICPE'17 - Call for Participation

2017-03-13 Thread Andrea Rosà
ICPE 2017 8th ACM/SPEC International Conference on Performance Engineering    Sponsored by ACM SIGMETRICS, SIGSOFT, and SPEC RG L'Aquila, Italy   April 22-27,

Re: [racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread David Storrs
On Mon, Mar 13, 2017 at 2:49 PM, George Neuner wrote: > > This is why you can't use prepared queries with virtual connections - > because there is no guarantee that the connection that prepared the query > will be the same one that tries to execute it. > *nod* Good,

Re: [racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread David Storrs
On Mon, Mar 13, 2017 at 2:04 PM, Ryan Culpepper wrote: > On 03/13/2017 12:49 PM, David Storrs wrote: > >> [...] >> >> >> Assuming I've understood all that correctly, my last question would be >> how to get around the 'can't do prepare with a virtual connection' issue >> for

Re: [racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread George Neuner
On 3/13/2017 3:41 PM, David Storrs wrote: On Mon, Mar 13, 2017 at 2:04 PM, Ryan Culpepper > wrote: If you are using `prepare` just for speed, it might help to know that most base connections have an internal statement cache that maps SQL strings to

Re: [racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread Ryan Culpepper
On 03/13/2017 03:16 PM, David Storrs wrote: [...] On Mon, Mar 13, 2017 at 2:49 PM, George Neuner > wrote: - It's also fine to pass the VC into other threads. It will be shared state between the threads, but the CP will keep their

Re: [racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread David Storrs
Thank you, everyone. I really appreciate the detailed answers. On Mon, Mar 13, 2017 at 5:16 PM, Ryan Culpepper wrote: > On 03/13/2017 03:16 PM, David Storrs wrote: > >> [...] >> On Mon, Mar 13, 2017 at 2:49 PM, George Neuner >

Re: [racket-users] refactoring help/tools?

2017-03-13 Thread Stephen De Gabrielle
Sorry - I meant to reply all. My questions weren't directed at anyone specific. S. On Mon, 13 Mar 2017 at 21:24, Stephen De Gabrielle wrote: > Do you mean a drracket plugin that > i. Expands #lang racket into racket/base and requires, > ii. removes the unneeded

Re: [racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread Ryan Culpepper
On 03/13/2017 04:56 PM, George Neuner wrote: On 3/13/2017 3:41 PM, David Storrs wrote: On Mon, Mar 13, 2017 at 2:04 PM, Ryan Culpepper > wrote: If you are using `prepare` just for speed, it might help to know that most base connections have an

Re: [racket-users] Virtual connections, threads, and DSN extraction, oh my!

2017-03-13 Thread George Neuner
On 3/13/2017 3:16 PM, David Storrs wrote: ... you talk about the "real connection", singular -- aren't there multiple real connections underlying the pool? Yes, a pool maintains some number of real connections to the DBMS. Note, however, that a pool can be configured to maintain just a