Yes! John just taught you how to fish.
> On Mar 22, 2017, at 3:51 PM, 'John Clements' via Racket Users
> wrote:
>
>
>> On Mar 22, 2017, at 12:45 PM, Angus wrote:
>>
>> I am a bit stuck on rendering images in a list.
>>
>> Here is my code below.
>>
>> (require 2htdp/image)
>>
>> (define
I think I've finally got something working within DrRacket so I've just
pushed a change to check-syntax[1] which adds a `Remove Unused Requires`
right-click menu item to DrRacket which will remove all requires which
check-syntax marks as unused.
If you're using DrRacket from github, I'd appreciate
Hi Angus
Usually it helps to start by getting something simple to work and then
little-by-little adding more.
E.g. Here's a working example with squares instead of bears, and limited to
just varying rotation ...
#lang racket
(require 2htdp/image)
(define blue-square (square 25 'solid 'blue))
Sorry for the short notice[*], but the FSF's major LibrePlanet
conference is this weekend at MIT.
Some of the talks look potentially relevant to Racketeers, like "The
Lisp machine and GNU" and "The set of programmers: How math restricts us".
Would be good to have some Racket presence there, m
> On Mar 22, 2017, at 12:51 PM, 'John Clements' via Racket Users
> wrote:
>
>> On Mar 22, 2017, at 12:45 PM, Angus wrote:
>>
>> render-bear works but I can't get render-bears to work. What am I doing
>> wrong? Any hints?
>
> Rendering bears is quite dangerous. I’m surprised you got even on
2thdp/image isn't effectful; images are values. You need to combine the
image you get from rendering one bear with the image you get from rendering
the rest of the list. You can do so using one of the combiners provided by
the library:
(combiner-of-choice (render-bear (first bears))
> On Mar 22, 2017, at 12:45 PM, Angus wrote:
>
> I am a bit stuck on rendering images in a list.
>
> Here is my code below.
>
> (require 2htdp/image)
>
> (define-struct bear-state (x y rotation size))
>
> (define MTS (empty-scene WIDTH HEIGHT))
>
> BEAR-IMAGE is just a graphic - of a bear.
I am a bit stuck on rendering images in a list.
Here is my code below.
(require 2htdp/image)
(define-struct bear-state (x y rotation size))
(define MTS (empty-scene WIDTH HEIGHT))
BEAR-IMAGE is just a graphic - of a bear.
(define (render-bear b)
(place-image (scale (bear-state-size b) (rota
> (prefix 6 5 4) raises the same error as before, and the definition of
> prefix/parse complains "syntax-parse: duplicate attribute in: tail".
This is because ~or behaves differently under ellipses, and nested ~or are just
inlined. Your code for prefix/parse is therefore equivalent to (~or alt1
To work with strings for the database, do something like this:
(define (serialize-to-string v)
(with-output-to-string
(λ () (write (serialize v)
(define (deserialize-from-string str)
(with-input-from-string str
(λ () (deserialize (read)
On Tuesday, March 21, 2017 at 8:52:55 PM U
10 matches
Mail list logo