
I am using (send dc draw-point x y)
to draw points. Here is an image where the size varies from 1 to 20.

If I zoom in on the points I see:

and further:

It seems as though none of them are symmetrical. The left colum and top row are “missing” everytime.

Is there anything I can do to make the points symmetrical (at least for some sizes)?

Okay - for some reason the smoothing wasn’t set to ’aligned (thus disabling antialising). But … even without antialias … shouldn’t points be symmetrical at least for some sizes?

Using (line x y (+ x <tel:00000000001\|0.0000000001>) y)
I can trick racket/draw
to draw a very short line. The points do become symmetrical. I notice that (line x y x y)
is caught in (send dc draw-line ...)
and calls draw-point
.

The Racket code in question: https://github.com/racket/draw/blob/master/draw-lib/racket/draw/private/dc.rkt#L1162 And a recommendation from the Cairo mailing list: https://lists.cairographics.org/archives/cairo/2009-June/017459.html

8.1 out yet :0 ?

not yet, should be out soon

What’s the best way to yacc into syntax objects?

@jagen315 if you want to take a BNF grammar and get a parser that makes syntax objects, I’d suggest https://docs.racket-lang.org/brag/index.html?q=brag

@mflatt when supplying a function as the read-in
argument to make-input-port
, if the function returns an input-port
rather than a pipe-input-port
, the program will get stuck

(define-values (in out) (make-pipe #f 'hello 'world))
;; (write "hello" out)
(define (foo s)
(open-input-file "./README.md"))
(read (make-input-port 'test
foo
#f
void))

should we report an error here? like one when applying pipe-content-length
to such a port

Since the result is not a pipe input port, it’s treated as a generic evt. As an evt that’s ready, a port returns itself… so that’s considered another evt to try, and so on. That’s definitely confusing, but it’s not an error.

this was surprisingly easy. I suppose I was avoiding it because I viewed it as a teaching language

Ah, thank you. For Typed Racket, it would make more sense to add a type to describe pipe-port so we can avoid the confusion

but looks like we need export pipe-input-port? and pipe-out-port? in Racket first …

Brag is very powerful, being able to handle any context-free grammar. Although, if I understand correctly, it has similar performance to other parser generator frameworks, assuming that your language grammar is restricted to a particular class, like LL(k).

@jmd1011 has joined the channel