You can use convert-syntax-error from syntax/macro-testing to convert
the syntax error to a runtime error, which can be caught by RackUnit:
http://docs.racket-lang.org/syntax/macro-testing.html#%28form._%28%28lib._syntax%2Fmacro-testing..rkt%29._convert-syntax-error%29%29
Alexis
> On Apr 25, 201
Sorry for forgot to mention Racket version. It is 6.8.
--
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+unsubscr...@googlegroups.com.
For more option
Hi there,
I am writing a simple macro `if-let` that tried to bind the condition to a
variable.
```
(define-simple-macro (if-let (~describe "binding pairs" [binding:expr
value:expr])
(~describe "\"then\" clause" then:expr)
(~describe "\"e
Are you repeatedly generating image for an animation inside an event loop?
Depending on the kind of program `freeze` from 2htdp/image may help if you
haven't tried already. For example this[1] program renders faster with
freeze both in RacketScript and 2htdp/image.
[1] http://rapture.twistedplane
On Wednesday, April 26, 2017 at 12:09:54 PM UTC+8, Daniel Prager wrote:
> Much as I enjoy making images using 2htdp/image it does get a tad slow as
> complexity increases.
>
> I currently have a program in which I generate images in 2htdp/image and
> translate them into bitmap%s per racket/gui a
Hi Daniel,
I have a functional bitmap library[1] as a part of my CSS engine.
This library is inspired by the official pict-lib and flomap(images-lib),
and handles bitmap% directly.
I don't think it is efficient enough since every functional operation
creates another bitmap%.
Here I recommend you
On Wednesday, April 26, 2017 at 12:12:26 PM UTC+8, David K. Storrs wrote:
>
> I could do it with a parameter but that's only sweeping the above ugliness
> under the rug:
>
> (define conf (make-parameter #f))
>
> (define (read-conf)
> (or (conf)
> (begin
> (conf (with-inp
I don't know that there's a right way, but if your functions are
nullary, then promises are a decent fit:
(define conf
(delay
(with-input-from-file ...)))
Then just (force conf) whenever you want the value.
On Wed, Apr 26, 2017 at 12:12 AM, David Storrs wrote:
> Reading configuration fi
In this very simple case, I would probably not define a function at all,
just something like
(define conf
(with-input-from-file "db.conf"
read-json))
You may also find yourself wanting define-runtime-path from
racket/runtime-path.
On Tue, Apr 25, 2017 at 11:12 PM, David Storrs
wrote:
>
Reading configuration files is a good example of a run-once function. It's
effectively self-memoizing -- it should run once, cache its result, and on
future calls just return the cached value. I could pull in
https://docs.racket-lang.org/memoize/index.html or
http://docs.racket-lang.org/mischief@
Much as I enjoy making images using 2htdp/image it does get a tad slow as
complexity increases.
I currently have a program in which I generate images in 2htdp/image and
translate them into bitmap%s per racket/gui and render on canvas%'s via a
dc.
Speed has become sluggish and I'm going to need to
Thanks Ryan, I had forgotten that those were there.
--
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+unsubscr...@googlegroups.com.
For more option
+1 to Robby's idea :P
On Tue, Apr 25, 2017 at 9:50 PM, Robby Findler
wrote:
> "..., Hooray!" ? :)
>
> Robby
>
> On Tue, Apr 25, 2017 at 8:46 PM Jordan Johnson wrote:
>>
>> On Apr 25, 2017, at 6:09 PM, Matthias Felleisen
>> wrote:
>> > While I am at it, let me advocate PITCH as the slogan for Pr
"..., Hooray!" ? :)
Robby
On Tue, Apr 25, 2017 at 8:46 PM Jordan Johnson wrote:
> On Apr 25, 2017, at 6:09 PM, Matthias Felleisen
> wrote:
> > While I am at it, let me advocate PITCH as the slogan for Proper
> Implementation of Tail Calls. (Where does the H come from? I added it to
> make a co
On Apr 25, 2017, at 6:09 PM, Matthias Felleisen wrote:
> While I am at it, let me advocate PITCH as the slogan for Proper
> Implementation of Tail Calls. (Where does the H come from? I added it to make
> a complete word.)
Proper Implementation of Tail Call Handling? :)
Cheers,
Jordan
--
You
Brendan,
you’re correct in attributing the idea that the proper implementation of tail
calls is far less important to the Scheme and Racket community. Dybvig
expressed this idea first in a talk titled a Bag of Hacks in the early 90s.
Matthew then at some point said that the true goal is to n
Good points: It wasn't strictly true to say that you can make non-tail calls
"without fear." Rather, your memory for continuation frames is shared with, and
just as large as, any other kind of data.
--
You received this message because you are subscribed to the Google Groups
"Racket Users" gro
Ah, lucky you. This is not a "stack overflow". This is a "all of memory
overflow". The cool thing about racket is that there is not separate limit
on some mysterious PL-internal data structure called a "stack".
Robby
On Tue, Apr 25, 2017 at 6:13 PM Matthew Butterick wrote:
>
> > On Apr 25, 2017
On Tue, Apr 25, 2017 at 6:37 PM, brendan wrote:
> Scheme implementations are required to have proper tail recursion. Racket
> goes further and lets the programmer make recursive calls from any position
> without fear because, to paraphrase Dr. Flatt, it's the 21st century and
> stack overflows
> On Apr 25, 2017, at 4:05 PM, brendan wrote:
>
> Indeed; I should have clarified that I didn't mean only recursion per se. Not
> the first time I've stumbled on that misnomer.
>
> On Tuesday, April 25, 2017 at 6:53:59 PM UTC-4, Robby Findler wrote:
>> I think the question is about non-tail ca
> On Apr 25, 2017, at 4:05 PM, brendan wrote:
>
> Indeed; I should have clarified that I didn't mean only recursion per se. Not
> the first time I've stumbled on that misnomer.
Forgive me. In that case, I’m not sure exactly what property it is you’re
looking for a name for.
:)
John
--
Indeed; I should have clarified that I didn't mean only recursion per se. Not
the first time I've stumbled on that misnomer.
On Tuesday, April 25, 2017 at 6:53:59 PM UTC-4, Robby Findler wrote:
> I think the question is about non-tail calls and limits on them.
>
>
> Robby
>
>
>
> On Tue, Ap
I think the question is about non-tail calls and limits on them.
Robby
On Tue, Apr 25, 2017 at 5:52 PM 'John Clements' via Racket Users <
racket-users@googlegroups.com> wrote:
>
> > On Apr 25, 2017, at 3:37 PM, brendan wrote:
> >
> > Scheme implementations are required to have proper tail recur
> On Apr 25, 2017, at 3:37 PM, brendan wrote:
>
> Scheme implementations are required to have proper tail recursion. Racket
> goes further and lets the programmer make recursive calls from any position
> without fear because, to paraphrase Dr. Flatt, it's the 21st century and
> stack overflow
Scheme implementations are required to have proper tail recursion. Racket goes
further and lets the programmer make recursive calls from any position without
fear because, to paraphrase Dr. Flatt, it's the 21st century and stack
overflows should not be a thing. My questions are: Is there a name
You might be interested in `dsn-connect` and the `data-source` structure
(http://docs.racket-lang.org/db/connect.html#%28part._.Data_.Source_.Names%29).
Ryan
On 4/25/17 8:18 PM, David Storrs wrote:
Great. Thanks, Phillip!
On Tue, Apr 25, 2017 at 2:14 PM, Philip McGrath
mailto:phi...@philipm
Matthew,
I’m no lawyer, but...
On Tuesday, April 25, 2017 at 4:45:29 PM UTC+1, Matthew Butterick wrote:
> PS about Rosetta Code generally. As a user, its utility is hugely
> undermined by the fact that I can't take code from the site and easily
> adapt / reuse it (at least, if I want to comply wi
Call for Tutorials
Commercial Users of Functional Programming (CUFP) 2017
September 7th-9th, 2017, Oxford, United Kingdom
Co-located with International Conference on Functional Programming (ICFP)
Dear Racket community
Great. Thanks, Phillip!
On Tue, Apr 25, 2017 at 2:14 PM, Philip McGrath
wrote:
>
>1. Yes, that was supposed to be (current-database-handle)
>2. A struct would definitely be a reasonable choice for the spec, but
>you might just want to add a failure result to the hash-ref calls insid
1. Yes, that was supposed to be (current-database-handle)
2. A struct would definitely be a reasonable choice for the spec, but
you might just want to add a failure result to the hash-ref calls inside
initialize: in that case default-database-spec could just be #hasheq(), and
you wou
On Mon, Apr 24, 2017 at 9:46 PM, Philip McGrath
wrote:
> Another thing that might be relevant:
>>
>> In contrast, direct assignment to a parameter (by calling the parameter
>> procedure with a value) changes the value in a thread cell, and therefore
>> changes the setting only for the current thr
> On Apr 25, 2017, at 3:14 AM, Tim Brown wrote:
>
> 1 Volume: there are 932 tasks implemented on Rosetta Code; all of
> which have some value. Since I have contributed a fair number of
> these, I know that there is a good amount of time required to just
> review each of these pages.
PS ab
Matthew,
Food for thought -- so here’s a bit of thinking out loud.
On Tuesday, April 25, 2017 at 3:42:32 AM UTC+1, Matthew Butterick wrote:
> Instead of a wiki, perhaps consider collecting demo code samples into
> a new Racket package & adding explanations via Scribble docs. In turn,
> these will
Greg,
On Monday, April 24, 2017 at 9:13:30 PM UTC+1, Greg Trzeciak wrote:
> Regarding the Rosetta Code scraper - I have 90% of the task completed - I
> will post my code on github sometime tomorrow. It still needs some work to
> have it published - the number of code samples is huge so is the va
34 matches
Mail list logo