nested-flow and inset

25 views
Skip to first unread message

Shriram Krishnamurthi

unread,
Jul 11, 2020, 1:41:27 PM7/11/20
to Racket Users
My reading of the documentation for `nested-flow`


is that I can use 'inset as the first argument. However, when I try to do so, I get a contract error:

make-nested-flow: contract violation

  expected: style?

  given: 'inset

  in: the 1st argument of

      (-> style? (listof block?) nested-flow?)

  contract from: 

      <pkgs>/scribble-lib/scribble/core.rkt


This looks like it contradicts the documentation, which says that the first argument is any/c:



Even if the documentation is wrong, I'm not sure why 'inset is being rejected…

Thanks,
Shriram

Matthew Flatt

unread,
Jul 11, 2020, 1:47:27 PM7/11/20
to Shriram Krishnamurthi, Racket Users
At Sat, 11 Jul 2020 10:41:27 -0700 (PDT), Shriram Krishnamurthi wrote:
> My reading of the documentation for `nested-flow`
>
> https://docs.racket-lang.org/scribble/core.html#%28def._%28%28lib._scribble%2Fc
> ore..rkt%29._make-nested-flow%29%29
>
> is that I can use 'inset as the first argument. However, when I try to do
> so, I get a contract error:
>
> make-nested-flow: contract violation
>
> expected: style?
>
> given: 'inset
>
> in: the 1st argument of
>
> (-> style? (listof block?) nested-flow?)
>
> contract from:
>
> <pkgs>/scribble-lib/scribble/core.rkt
>
> This *looks* like it contradicts the documentation, which says that the
> first argument is any/c:

You're right that the documentation is incorrect: It should say
`style?`. I'll fix that.

To construct a style that has 'nested as a property, use `(style #f
'(nested))` with `style` from `scribble/core`.

Helper functions like `nested` are more flexible and will auto-convert
a style-property symbol to a style, but the `nested-flow` constructor
isn't meant to do that.

Matthew Flatt

unread,
Jul 11, 2020, 1:50:34 PM7/11/20
to Shriram Krishnamurthi, Racket Users
At Sat, 11 Jul 2020 11:47:22 -0600, Matthew Flatt wrote:
> To construct a style that has 'nested as a property, use `(style #f
> '(nested))` with `style` from `scribble/core`.

Wrong again: That should have been be 'inset as a name, not 'nested as
a property, so `(style 'inset ())`.

Reply all
Reply to author
Forward
0 new messages