Re: [racket-users] Scribble and structs

2020-08-12 Thread Deren Dohoda
Solved some of which was offline.

First was my misunderstanding about having to document implied procedures
when using a struct. Second was that I missed a parameter
print-as-expression which should be parameterized as #f for the evaluator.

Thanks everyone!
Deren

On Wed, Aug 12, 2020, 7:08 AM Deren Dohoda  wrote:

> Hi racketeers,
>
> I have two questions. The first is: is there a way to have scribble /
> sandbox use the gen:custom-write property of a structure? When I use
> @examples the output is just the bare structure output, not using the
> gen:custom-write procedure.
>
> Second, I am working on a very simple polynomial library using 7.7 and
> during the creation of the docs I receive this warning:
> "WARNING: collected information for key multiple times: '(dep ((lib
> "simple-polynomial/main.rkt") polynomial?)); values: #t #t"
> among other similar warnings all seeming to point to the procedure
> polynomial?.
>
> This would lead me to believe I have somehow required or defined things
> multiple times. However my "main.rkt" is just a one file require and an
> all-from-out. The underlying library does not use (provide (struct-out
> ...)), I only (provide polynomial?).
>
> Do structs somehow mess with scribble here? A small search reveals only a
> single posting from the developers library with the comment "fix your
> library." Love to, but what's the problem?
>
> Thanks for any thoughts,
> Deren
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Racket Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/racket-users/oKtKqyQZDg4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/2ffd6a24-8437-4a7e-b688-74135a866673n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE-rtpnj5U8AG3yRYir5oMvHbHq9s0SfN9x-UYL29v4Rp-Fi-A%40mail.gmail.com.


Re: [racket-users] Scribble and structs

2020-08-12 Thread Deren Dohoda
Hi Matthew,

> A `@defstruct*[polynomial .]` form does document `polynomial?`.
> Although the word `polynomial?` doesn't appear on the page, it's
> implied by the `struct` form on the page.

Thank you, I understand.

Deren

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE-rtpm4SRSpBWNDfv1rCKJgc7bzpkFithao%2BB7U1R6200UEkQ%40mail.gmail.com.


Re: [racket-users] Scribble and structs

2020-08-12 Thread Matthew Flatt
At Wed, 12 Aug 2020 08:32:25 -0400, Deren Dohoda wrote:
> If I remove the @defproc of polynomial? then I do not get the error, though
> then of course that definition never appears in the document. However, if I
> instead remove the @defstruct* then the error also disappears. But
> @defstruct* does not document the automatically generated procedure so it
> seems that it shouldn't introduce it as far as scribble is concerned. Is
> this a bug?

A `@defstruct*[polynomial .]` form does document `polynomial?`.
Although the word `polynomial?` doesn't appear on the page, it's
implied by the `struct` form on the page.

As another example, if you search the docs for `exn?`, you'll arrive at
a `struct` declaration for `exn`, and not a separate `exn?` entry.


Matthew

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200812065032.249%40sirmail.smtps.cs.utah.edu.


Re: [racket-users] Scribble and structs

2020-08-12 Thread Deren Dohoda
Hi Matthew,

Structs should not cause any particular problem for Scribble. I'm
> puzzled by the problem with `gen:custom-write`, because that should
> certainly work with sandboxes and `@examples`.

I will try to look at some included documents with the main distribution to
see if I can figure out what I'm doing wrong then.

The "collected information multiple times" error would be caused by
> multiple declarations of `polynominal?` in the docs, as opposed to
> multiple definitions in the code. Depending on when the error happens,
> though, it could be due to multiple instances of a whole document, as
> Laurent suggests.
>
If I remove the @defproc of polynomial? then I do not get the error, though
then of course that definition never appears in the document. However, if I
instead remove the @defstruct* then the error also disappears. But
@defstruct* does not document the automatically generated procedure so it
seems that it shouldn't introduce it as far as scribble is concerned. Is
this a bug?

Deren

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE-rtpn9E_Qz78vi8FCbKkKKfugk-eWEgjo%2ByHn-raGO5Hu7rg%40mail.gmail.com.


Re: [racket-users] Scribble and structs

2020-08-12 Thread Matthew Flatt
At Wed, 12 Aug 2020 04:07:58 -0700 (PDT), Deren Dohoda wrote:
> I have two questions. The first is: is there a way to have scribble / 
> sandbox use the gen:custom-write property of a structure? When I use 
> @examples the output is just the bare structure output, not using the 
> gen:custom-write procedure.
> 
> Second, I am working on a very simple polynomial library using 7.7 and 
> during the creation of the docs I receive this warning:
> "WARNING: collected information for key multiple times: '(dep ((lib 
> "simple-polynomial/main.rkt") polynomial?)); values: #t #t"
> among other similar warnings all seeming to point to the procedure 
> polynomial?.
> 
> This would lead me to believe I have somehow required or defined things 
> multiple times. However my "main.rkt" is just a one file require and an 
> all-from-out. The underlying library does not use (provide (struct-out 
> ...)), I only (provide polynomial?). 
> 
> Do structs somehow mess with scribble here?

Structs should not cause any particular problem for Scribble. I'm
puzzled by the problem with `gen:custom-write`, because that should
certainly work with sandboxes and `@examples`.

The "collected information multiple times" error would be caused by
multiple declarations of `polynominal?` in the docs, as opposed to
multiple definitions in the code. Depending on when the error happens,
though, it could be due to multiple instances of a whole document, as
Laurent suggests.


Matthew

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20200812061131.3d1%40sirmail.smtps.cs.utah.edu.


Re: [racket-users] Scribble and structs

2020-08-12 Thread Laurent
I have no idea about custom-write, but for the duplicate keys, maybe you
installed the collection multiple times? Take a look at the output of `raco
pkg show` maybe.

On Wed, Aug 12, 2020 at 12:08 PM Deren Dohoda 
wrote:

> Hi racketeers,
>
> I have two questions. The first is: is there a way to have scribble /
> sandbox use the gen:custom-write property of a structure? When I use
> @examples the output is just the bare structure output, not using the
> gen:custom-write procedure.
>
> Second, I am working on a very simple polynomial library using 7.7 and
> during the creation of the docs I receive this warning:
> "WARNING: collected information for key multiple times: '(dep ((lib
> "simple-polynomial/main.rkt") polynomial?)); values: #t #t"
> among other similar warnings all seeming to point to the procedure
> polynomial?.
>
> This would lead me to believe I have somehow required or defined things
> multiple times. However my "main.rkt" is just a one file require and an
> all-from-out. The underlying library does not use (provide (struct-out
> ...)), I only (provide polynomial?).
>
> Do structs somehow mess with scribble here? A small search reveals only a
> single posting from the developers library with the comment "fix your
> library." Love to, but what's the problem?
>
> Thanks for any thoughts,
> Deren
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/2ffd6a24-8437-4a7e-b688-74135a866673n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CABNTSaFi8JZaMUkGOXXorTGN0Cj0yW8LZJ5Ukh0sy%3D9RiOR6_A%40mail.gmail.com.


[racket-users] Scribble and structs

2020-08-12 Thread Deren Dohoda
Hi racketeers,

I have two questions. The first is: is there a way to have scribble / 
sandbox use the gen:custom-write property of a structure? When I use 
@examples the output is just the bare structure output, not using the 
gen:custom-write procedure.

Second, I am working on a very simple polynomial library using 7.7 and 
during the creation of the docs I receive this warning:
"WARNING: collected information for key multiple times: '(dep ((lib 
"simple-polynomial/main.rkt") polynomial?)); values: #t #t"
among other similar warnings all seeming to point to the procedure 
polynomial?.

This would lead me to believe I have somehow required or defined things 
multiple times. However my "main.rkt" is just a one file require and an 
all-from-out. The underlying library does not use (provide (struct-out 
...)), I only (provide polynomial?). 

Do structs somehow mess with scribble here? A small search reveals only a 
single posting from the developers library with the comment "fix your 
library." Love to, but what's the problem? 

Thanks for any thoughts,
Deren

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2ffd6a24-8437-4a7e-b688-74135a866673n%40googlegroups.com.