Could anyone tell me how to open a tab in chrome from Racket? I can’t seem to find anything but I know it’s possible because the DrRacket help does it.
@soegaard2 Thanks, couldn’t see the wood for the trees
talk about beginner! (for/list ((i '(1 2 3)))
(* i 2))
returns '(2 4 6)
but
(for ((i '((1 2 3) (4 5 6))))
(for/list ((j i))
(* j 2)))
returns nothing
I am not sure why … thanks for the help!
AHHH!!! Because the enclosing (for ...)
ignores the result of evaluating the body …. doh!!
but (for/list ((i '((1 2 3) (4 5 6))))
(for/list ((j i))
(* j 2)))
returns '((2 4 6) (8 10 12))
- excellent!
:wave: How can I check if a keyword argument was given during the function call or if I’m just seeing the default value?
I remember seeing something like (define (fn #:kw [kw default arg-was-given]))
but it looks like I’m mistaken on this
or this was another scheme and not racket
?
@khepin make the default value be something that the caller can’t provide
@khepin however, I find that APIs defined that way are usually problematic
(define invalid (λ () 'invalid))
(define (valid? value)
(not (eq? value invalid)))
(define (fn [a invalid])
(when (valid? a) ...))
:point_up:what I did in the end