Bitmaps created using pict->bitmap look pixelated to me on screen (on Mac
OS in "Retina" mode, which I suspect might be relevant). I initially
discovered this when using picts as labels for message% instances like this:
#lang racket/gui
(require pict)
(define f
(new frame%
[label "Examp
Well, actually that will be nested vectors, I just used list as example.
I thought about storing arrays as one-dimentional vectors, but it makes hard to
work with literal arrays. If I use nested vectors, then I can write something
like:
(matrix-* A #[#[1 2 3] #[4 5 6]])
--
You received this m
Daniel, thank you for your response!
It really helped. I've focuded too much on recursion and tried to put nested
array generation into it, without realizing that I can use external loop.
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsu
Hi Vasily
Since you insist ... ;-)
The main issue is how to reduce the number of args with each step of the
recursion: looks like a job for curry!
Here's one way to do it:
(define (generate-array n f)
(for/list ([i 3])
(if (= n 1)
(f i)
(generate-array (sub1 n) ((curry f)
(If this is for a school assignment, and the following comments are
confusing, please disregard them. The comments might make a school
assignment harder than it's supposed to be.)
Are you sure you want your n-dimensional arrays to be implemented as
nested Racket lists?
What about a 1-dimens
My current approach is to try to make recursion that will expand into somethig
like this (for generator functions that accepts 1, 2 and 3 arguments
respectively):
(define (bv func)
(build-vector 3 func))
((lambda (f) (bv (lambda (x)
(f x generator)
((lambda (f) (bv (la
On Thursday, July 13, 2017 at 9:30:44 PM UTC+2, Daniel Prager wrote:
> It's straightforward to design a recursive macro with similar intent, but
> different surface syntax:
>
> (generate-array (i) 10)
> (generate-array (i) i)
> (generate-array (i j) (+ (* 10 i) j))
>
>
> Dan
Thanks for the an
It's straightforward to design a recursive macro with similar intent, but
different surface syntax:
(define-syntax generate-array
(syntax-rules ()
[(_ (i) exp) (for/list ([i 3]) exp)]
[(_ (i j...) exp) (for/list ([i 3]) (generate-array (j...) exp))]))
(generate-array (i) 10)
(generate-a
I need to write function generete-array:
(define (generate-array num-dimensions generator)
...)
such that it generate num-dimensions array (each dimension is of size 3) and
uses generator function to produce elements of array (generator accepts
num-dimensions arguments and returns number; ea
You probably want to look at
http://docs.racket-lang.org/reference/Exiting.html for the
exit-handler or executable-yield-handler, or for a more general
system, plumbers: http://docs.racket-lang.org/reference/plumbers.html
Sam
On Thu, Jul 13, 2017 at 9:50 AM, David Storrs wrote:
> Short form: Ho
Short form: How can I define a block of code such that it will run
immediately before the program ends?
What I'm trying to achieve: Make my testing module (which is not rackunit)
check whether or not the expected number of tests ran. I'd also like to
know the answer to the 'run at program shutdo
> I hope this is heading in the right direction.
Looks fine to me.
--
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.
Fo
Hey,
just to add another idea:
>
> Don't be scared away from coding your own Scheme from scratch. A whole
> lot of them got started that way, because it's easy to code your own (If
> you borrow existing approaches for garbage collection and evaluation
> with tail calls), then do something diffe
13 matches
Mail list logo