
@asikts has joined the channel

@ryanc I’m trying to understand how to use pslide
with #:alt
and it’s not making sense

In particular I want to first show pict a
and then show pict b
at the same location

this is pretty easy with 'alts
in regular slides

but the obvious ways to do with #:alts
produce too many extra slides

@samth here’s one example: #lang racket
(require slideshow ppict/2)
(pslide
#:go (coord 1/2 1/3 'ct)
(t "Let's talk about ")
#:go (coord 1/2 1/2 'ct)
#:alt ((bt "types")
#:next (para "Types are cool."))
(bt "macros")
#:next
(para "Macros are nice."))

ah, the trick is to put the last alternate outside of #:alt

thanks!

Is there a way to get the next-largest or next-smallest flonum in Racket, a la the nextafter
function in C’s math.h?

@lexi.lambda i thought there was something like that in one of @ntoronto’s libraries

Ah, it looks like flstep
from math/flonum
will do it. Thanks!

@mflatt is there a way to run a module written in #lang slideshow
as if it was run under slideshow --widescreen
(ie in DrRacket)?

You can run slideshow --widescreen --save-aspect
once to configure the default.

ok, that helps, thanks

You could also set the command line in DrRacket to --widescreen
, but that’s probably less convenient

@mflatt found a problem with the search-context.html page (https://github.com/racket/racket/blob/master/pkgs/racket-index/scribblings/main/private/search-context.html#L18-L21), on current Edge in Win10. I don’t have a Windows laptop with me at the moment (am relaying what others have told me), but it seems that this particular use of URL
, searchParams
and/or keys
isn’t working quite right in Edge. If you have a windows box to take a look, please do; otherwise I’ll try to diagnose it further myself tonight

When reading the racket documentation and I find a procedure I want to use, how do i know what module I need to require?

usually the beginning of the section containing that function will document which modules to require

*subsection

e.g. split-at
is in doc 4.9.7, and the beginning of 4.9.7 says: (require racket/list) package: base
The bindings documented in this section are provided by the racket/list and racket libraries, but not racket/base.

In REPL, ,doc IDENTIFIER
sometimes helps

@shu—hung What does it mean if no “require” is listed?

I don’t know where that could be documented then :disappointed: how about trying ,doc
and ,desc
? $ racket
Welcome to Racket v7.0.0.12.
> ,doc parse-markdown
Loading help index...
No current binding, but provided by:
markdown/parse
> ,doc split-at
Sending to web browser...
file: <RACKET>/doc/reference/pairs.html
anchor: (def._((lib._racket/list..rkt)._split-at))
> ,desc split-at
; `split-at' is a bound identifier,
; defined in <collects>/racket/list.rkt
; required through "<collects>/racket/init.rkt"

what function are you looking for?

4.3.2 String Comparisons, string=?

it’s provide by racket/base

,desc looks useful. I’ll give that a go.

and racket

well, string=?
is provide by racket/base
and racket
; since these 2 packages are sort of standard, it’s only mentioned at the front page of Racket Reference

@shu—hung I see thank you for helping me understand how to better navigate the documentation. Much appreciated.

Is there a way forward a syntax object in a macro? A simplified example of what I want to do: (define-syntax (foo stx)
(match-define (list _ expr-stx) (syntax->list stx))
(syntax-parse expr-stx
[(_ bar)
;; I want to provide the syntax expr-stx as an argument
(some-proc bar expr-stx)]))
What happens when I do the above is the error unbound identifier in module in: expr-stx

you want (some-proc bar (quote-syntax #,expr-stx))

the #,
is because expr-stx
is a regular variable, not a pattern variable

and the quote-syntax
is to quote it so that it’s data

@samth Thanks for the help. The code I’m working with is slightly different then what I pasted. It has a syntax/loc It looks like this. (define-syntax (foo stx)
(match-define (list _ expr-stx) (syntax->list stx))
(syntax-parse expr-stx
[(_ bar)
(syntax/loc expr-stx (some-proc bar expr-stx))]))
Adjusted for quote-syntax as follows I still get the same error (define-syntax (foo stx)
(match-define (list _ expr-stx) (syntax->list stx))
(syntax-parse expr-stx
[(_ bar)
#`(syntax-loc expr-stx (some-proc bar #,expr-stx))]))
Do you know how I could forward it with the added syntax-loc?

you want the last line to be: (quasisyntax/loc expr-stx (some-proc bar (quote-syntax #,expr-stx)))

@samth awesome and thank you. I’ll give that a whirl :slightly_smiling_face:
