Usually you adjust the drawing context's scale. Something like (untested):
(define bm (read-bitmap ...))
(define dc (send image-box get-dc))
(define t (send dc get-transformation)) ; save old scale
(send dc scale
(/ (send image-box get-width) (send bm get-width))
(/ (send image-box
(define image-box
(new canvas% [parent frame]
[min-width 300]
[min-height 300]))
I'm still trying to figure out how the racket/gui library works but I'm
having some difficulty understanding how to have an image fill a canvas.
I'd like for instance to have a canvas in my gui that
I typically use either threading or composition...
(require threading)
(define (foo x)
(~> x
f g h bar))
or
(define (foo x)
((compose bar h g f) x)
A.
On Sunday, 12 August 2018 00:11:19 UTC+10, Robert Heffernan wrote:
>
> Dear all,
>
> I am new to Racket and only slightly less
Timothy Sample writes:
> Christopher Lemmer Webber writes:
>
>> Konrad Hinsen writes:
>>
>>> In my tests, all packages ended up working, but performance is indeed
>>> worse than with a Racket installation outside of Guix.
>>>
>>> It would be nice if someone with more knowledge of Racket
There are basically two differences between the `unsafe-lsb` function
in Racket and the C one:
- the Racket calling convention vs the C calling convention
- the instruction used to perform the LSB calculation
For a variety of reasons Racket's function calling convention is more
heavyweight than
>
>
>
> My question is: is the way I'm writing things considered to be bad
> style? It feels like a hangover from more imperative-style programming
> & the inclination to do one thing "per line". On the other hand, it
> often helps readability.
>
I invariably write my code like this. I just
> On Aug 11, 2018, at 9:00 AM, Sage Gerard wrote:
>
> I'm starting to think writing these kind of exercises in a friendly way is
> only possible with macros, but before I go that far, is it possible for me to
> catch a module-level unbound identifier error and print a rackunit failure
>
Would convert-syntax-error and convert-compile-time-error work? Sure
they are macros, but wrapped up in a nice way.
https://docs.racket-lang.org/syntax/macro-testing.html
On Sat, Aug 11, 2018 at 11:00 AM, Sage Gerard wrote:
> Hi all,
>
> Still working the koans project and am hitting a design
Hi all,
Still working the koans project and am hitting a design snag. My expected
UX is that you clone the repo, run racket koans/all.rkt, and then see
nothing but failing unit tests for you to fix. But since some exercises
have unbound module identifiers
For small expressions it probably does not matter, but suitably naming
intermediate expressions is definitely a good approach as it
`explains' the code. Also, replacing let* by define can reduce nesting
level. These 2 points are suggested in the style guide 4.2 and 4.4:
Konrad Hinsen writes:
> On 22/05/2018 15:42, Christopher Lemmer Webber wrote:
>
>> Unfortunately when I try to install packages with "raco pkg install"
>> I get errors like the following:
>
> I filed a bug report about this problem a while ago:
>
>
My advice would be to follow your own taste. But drop the brackets.
On Saturday, August 11, 2018 at 4:11:19 PM UTC+2, Robert Heffernan wrote:
>
> Dear all,
>
> I am new to Racket and only slightly less new to scheme & scheme-like
> languages.
>
> I have noticed myself often doing something
Dear all,
I am new to Racket and only slightly less new to scheme & scheme-like
languages.
I have noticed myself often doing something like the following:
(define (foo x)
(let* ([y (f x)]
[z (g y)]
[p (h z)])
(bar p)))
Which could, of course, be written as
(define (foo
Want to work on "libre" privacy-respecting applications in Racket, but
would rather work on servers, than on handheld/desktop apps, right now?
It would be good to have a home/family (or small business?) "cloud"
server that one can run at home, and customize in Racket.
Perhaps in the spirit
Hi,
In http://felleisen.org/matthias/manifesto/, you can read:
"In support, Racket offers protection mechanisms to implement a full
language spectrum, from C-level bit manipulation to soundly typed
extensions."
What are we talking about here when we mention C-level bit manipulation?
Is this
15 matches
Mail list logo