Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Kevin Forchione
> On Jul 11, 2019, at 12:34 PM, Alex Knauth wrote: > > > >> On Jul 11, 2019, at 1:15 PM, Kevin Forchione > > wrote: >> >>> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen >> > wrote: >>> >>> [(contract (-> string? integer?) (λ (x) x)

Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Alex Knauth
> On Jul 11, 2019, at 1:15 PM, Kevin Forchione wrote: > >> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen >> wrote: >> >> [(contract (-> string? integer?) (λ (x) x) 'a 'b) >> "hello”] > > By the way, I’ve been playing around with this (and define/contract) and it > seems that ‘a in the

Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Kevin Forchione
> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen > wrote: > > > [(contract (-> string? integer?) (λ (x) x) 'a 'b) > "hello”] By the way, I’ve been playing around with this (and define/contract) and it seems that ‘a in the above refers to the function itself, while to the best of my

Re: [racket-users] Re: Thinking in scheme / racket

2019-07-11 Thread Jens Axel Søgaard
Den tor. 11. jul. 2019 kl. 15.40 skrev Bob Heffernan < bob.heffer...@gmail.com>: > On 19-07-11 09:31, James Geddes wrote: > > Indeed, I would have thought that the calculation time would be > > entirely dominated by the test for primality, and especially what > > happens once the candidate primes

[racket-users] Re: Thinking in scheme / racket

2019-07-11 Thread Josh Rubin
On Tuesday, July 9, 2019 at 8:09:04 AM UTC-4, Bob Heffernan wrote: > > Dear all, > > I recently wanted to count the number of primes in the sequences 2^n+3 > and 2^n-3 (and a few more besides) where n is a positive integer. > > Hi Bob. This has nothing to do with Racket, and you may already

Re: [racket-users] Re: Thinking in scheme / racket

2019-07-11 Thread Matthias Felleisen
If I may, let me address the (at least) four dimensions of coding that have come up in this thread, as concretely as possible but with some generalizations added: 1. Performance Generally speaking, Python is a thin layer over C. It comes with almost all the performance advantages of C and

Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Kevin Forchione
> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen > wrote: > > > [(contract (-> string? integer?) (λ (x) x) 'a 'b) > "hello”] Incidentally, I’m not sure why, it must be something to do with the way I take apart and put together the world (i.e. the way I “learn” :) , but until a few posts

Re: [racket-users] Contracts in lambda?

2019-07-11 Thread Kevin Forchione
> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen > wrote: > > > [(contract (-> string? integer?) (λ (x) x) 'a 'b) > "hello”] > Nice! Thanks! Kevin -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and

Re: Re: [racket-users] Thinking in scheme / racket

2019-07-11 Thread matthias
If I may, let me address the (at least) four dimensions of coding that have come up in this thread, as concretely as possible but with some generalizations added: 1. Performance Generally speaking, Python is a thin layer over C. It comes with almost all the performance advantages of C and

Re: Re: [racket-users] Thinking in scheme / racket

2019-07-11 Thread James Geddes
Dear Bob, My sense is that there are, perhaps, two questions: first, what's the advantage of Racket when faced with a "prosaic computational task where ... my brain defaults to writing in something like C"?; and second, how to advocate for Racket when Python (appears to be) "quite a bit

Re: [racket-users] Re: Thinking in scheme / racket

2019-07-11 Thread Bob Heffernan
On 19-07-11 00:44, Maciek Godek wrote: > I also think that functional programming perhaps seems to make little sense > in a small scale, but as your programs grow large, it becomes increasingly > important. Maciek, You know, I think you might be right and I think this might be at the root of my

Re: [racket-users] Re: Thinking in scheme / racket

2019-07-11 Thread Bob Heffernan
On 19-07-11 09:31, James Geddes wrote: > Indeed, I would have thought that the calculation time would be > entirely dominated by the test for primality, and especially what > happens once the candidate primes are bigger than 2^64 and can no > longer be represented by a single word. James, I

Re: [racket-users] Specializing functions accepting keywords

2019-07-11 Thread Philip McGrath
The easiest way I know is to use `curry`, since Alexis fixed its keyword argument support last year: #lang racket (define (fish #:name[name #f] #:color [color #f] #:studio

Re: [racket-users] Advice for porting Interactive Brokers API to Racket

2019-07-11 Thread Greg Hendershott
Some systems provide a way to query for a capability: COM has QueryInterface, Racket dynamic-require, Emacs fboundp, and so on. When such a query method is available, you can simply ask for the thing you need or prefer. If it's available, great. If not, act appropriately: Fail, or use your own

Re: [racket-users] Re: Thinking in scheme / racket

2019-07-11 Thread James Geddes
I am also interested in this problem, because many of my colleagues use Python and "isn't Python faster?" is a common argument. (Albeit one that I think is more of a rationalisation than an reason.) In this case, however, I would not have thought that there's any prima facie reason why the

Re: [racket-users] Re: Thinking in scheme / racket

2019-07-11 Thread Maciek Godek
Hi Bob! W dniu czwartek, 11 lipca 2019 03:36:32 UTC+2 użytkownik Bob Heffernan napisał: > > On 19-07-10 02:46, Maciek Godek wrote: > > A while ago, I wrote a booklet which used almost the same problem to > > introduce to, what you called nicely in the title of this thread, > "thinking > > in