Re: [racket-users] Manually create cpointer value in racket?

2020-10-07 Thread Nathaniel Griswold
Ah, that’s perfect thanks. Totally missed the miscellaneous support section.

> On Oct 7, 2020, at 4:08 PM, Matthew Flatt  wrote:
> 
> Probably you want to use `cast`. If you have an integer `addr` that
> corresponds to an address, then
> 
> (cast addr _uintptr _pointer)
> 
> casts it to a C pointer.
> 
> Matthew
> 
> At Wed, 7 Oct 2020 10:28:42 -0500, Nathaniel Griswold wrote:
>> Related to a question I asked earlier, but this time at the racket side:
>> 
>> Is there any way to manually construct a cpointer with a raw pointer value? 
>> I 
>> suppose this would mean being able to construct a chez record in racket.
>> 
>> My use case is that I have a remote process talking to a racket process, it 
>> is 
>> sending a pointer to some shared memory and I want to access that shared 
>> memory. It’s an array of c structs with some integer data and each has a 
>> pointer to some raw bytes.
>> 
>> Any way to do it?
>> 
>> Thanks
>> 
>> -- 
>> 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/CDC4A5DF-6BE1-4B96-BF3A-0B19F2EB
>> F0AC%40gmail.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/4218EB80-31C5-4011-B217-5B1F87E76A5E%40gmail.com.


Re: [racket-users] Manually create cpointer value in racket?

2020-10-07 Thread Matthew Flatt
Probably you want to use `cast`. If you have an integer `addr` that
corresponds to an address, then

 (cast addr _uintptr _pointer)

casts it to a C pointer.

Matthew

At Wed, 7 Oct 2020 10:28:42 -0500, Nathaniel Griswold wrote:
> Related to a question I asked earlier, but this time at the racket side:
> 
> Is there any way to manually construct a cpointer with a raw pointer value? I 
> suppose this would mean being able to construct a chez record in racket.
> 
> My use case is that I have a remote process talking to a racket process, it 
> is 
> sending a pointer to some shared memory and I want to access that shared 
> memory. It’s an array of c structs with some integer data and each has a 
> pointer to some raw bytes.
> 
> Any way to do it?
> 
> Thanks
> 
> -- 
> 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/CDC4A5DF-6BE1-4B96-BF3A-0B19F2EB
> F0AC%40gmail.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/20201007150803.1b%40sirmail.smtps.cs.utah.edu.


[racket-users] VSCode users what extensions do you use for Racket programming?

2020-10-07 Thread Stephen De Gabrielle
VSCode users what extensions do you use for Racket programming?
https://marketplace.visualstudio.com/search?term=Racket=VSCode=Programming%20Languages=Relevance
I’m updating the wiki page
https://github.com/racket/racket/wiki/IDE%27s-and-text-editors
but I’m not a VSC user so I need your advice!

KR
Stephen

-- 
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/CAGHj7-LGT9PkjwzRMqL6-dDt9KKkf_SFZgoyF5HqeWHpT5ByDQ%40mail.gmail.com.


Re: [racket-users] #:kind (list ... ) in defthing and defproc

2020-10-07 Thread Robby Findler
Ah, sorry! I missed that `content?` was okay. Thanks, Matthew!

Robby


On Wed, Oct 7, 2020 at 8:40 AM Matthew Flatt  wrote:

> A recent commit added a contract on `defthing` and `defproc` to enforce
> the documented constraint that `#:kind` should be a string. But the
> implementation is happy with content in the sense of `content?`.
>
> Since it's easy to adjust the contract and documentation to restore
> this capability, I'll do that, and then this example works again.
>
> Matthew
>
> At Sat, 26 Sep 2020 21:06:20 +0200, Jos Koot wrote:
> > The following works well in DrRacket, version 7.8 [3m]
> >
> > #lang scribble/manual
> > @deftogether[
> > (@defthing[#:kind "constant false/on/high" F trit? #:value '0]
> >  @defthing[#:kind (list "constant true/off/low" (hspace 1)) T trit?
> #:value
> > '1]
> >  @defthing[#:kind "constant indeterminate" ? trit? #:value '?]
> >  @defthing[#:kind (list "constant" (hspace 13)) trits (list/c trit? trit?
> > trit?) #:value (list F T ?)]
> >  @defthing[#:kind (list "constant" (hspace 13)) in-trits sequence?
> #:value
> > (in-list trits)]
> >  @defproc[#:kind (list "predicate" (hspace 12)) (trit? (obj any/c))
> > boolean?]
> >  @defproc[#:kind (list "predicate" (hspace 12)) (F? (obj any/c))
> boolean?]
> >  @defproc[#:kind (list "predicate" (hspace 12)) (T? (obj any/c))
> boolean?]
> >  @defproc[#:kind (list "predicate" (hspace 12)) (?? (obj any/c))
> > boolean?])]{}
> >
> > I use hspace for alignment of the kinds.
> >
> > But in version 7.8.0.10--2020-09-25(515012525c/a) [3m] I get:
> >
> > . . C:\Program Files\Racket-7.8.0.10\collects\syntax\contract.rkt:101:21:
> > defthing: contract violation
> >   expected: (or/c string? #f)
> >   given: ("constant true/off/low" #(struct:element hspace (" ")))
> >   in: (or/c string? #f)
> >   macro argument contract on #:kind argument
> >   contract from:
> >   (lib scribble/private/manual-proc.rkt)
> >   blaming: E:\circuits\circuit-manual.scrbl
> >(assuming the contract is correct)
> >   at: E:\circuits\circuit-manual.scrbl:416.18
> >
> > Because I don't know whether or not this is a known issue, I post it on
> > this list.
> > If this is a known issue or an intentional change, then ignore this
> email,
> > please.
> > If not I can post it as a racket issue.
> > Let me know, please.
> > Thanks, Jos
> >
> > --
> > 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/CAL6KNi3P251G%2BBMQqDbo2qt6K22Gw
> > _OOgjjnHDboLLuC3qKrGg%40mail.gmail.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/20201007074018.1a7%40sirmail.smtps.cs.utah.edu
> .
>

-- 
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/CAL3TdONrEQoOmJaQqTyftX_QONjhp5TK-RnSzN9%3Dqx1K9uhrxQ%40mail.gmail.com.


[racket-users] Re: Manually create cpointer value in racket?

2020-10-07 Thread Nathaniel Griswold
And by “remote process” I just mean a separate process, the parent is sending 
it to the child.

> On Oct 7, 2020, at 10:28 AM, Nathaniel Griswold  
> wrote:
> 
> Related to a question I asked earlier, but this time at the racket side:
> 
> Is there any way to manually construct a cpointer with a raw pointer value? I 
> suppose this would mean being able to construct a chez record in racket.
> 
> My use case is that I have a remote process talking to a racket process, it 
> is sending a pointer to some shared memory and I want to access that shared 
> memory. It’s an array of c structs with some integer data and each has a 
> pointer to some raw bytes.
> 
> Any way to do it?
> 
> Thanks

-- 
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/5565C398-9CD0-4A4E-B3DB-028BBC189D5C%40gmail.com.


[racket-users] Manually create cpointer value in racket?

2020-10-07 Thread Nathaniel Griswold
Related to a question I asked earlier, but this time at the racket side:

Is there any way to manually construct a cpointer with a raw pointer value? I 
suppose this would mean being able to construct a chez record in racket.

My use case is that I have a remote process talking to a racket process, it is 
sending a pointer to some shared memory and I want to access that shared 
memory. It’s an array of c structs with some integer data and each has a 
pointer to some raw bytes.

Any way to do it?

Thanks

-- 
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/CDC4A5DF-6BE1-4B96-BF3A-0B19F2EBF0AC%40gmail.com.


RE: [racket-users] #:kind (list ... ) in defthing and defproc

2020-10-07 Thread Jacob Jozef
Thanks Matthew, that’s great.Jos From: Matthew FlattSent: miércoles, 7 de octubre de 2020 15:40To: Jos KootCc: Racket UsersSubject: Re: [racket-users] #:kind (list ... ) in defthing and defproc A recent commit added a contract on `defthing` and `defproc` to enforcethe documented constraint that `#:kind` should be a string. But theimplementation is happy with content in the sense of `content?`. Since it's easy to adjust the contract and documentation to restorethis capability, I'll do that, and then this example works again. 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/EE56067B-3201-410E-B1F7-66C8C0DCC059%40hxcore.ol.


Re: [racket-users] Security: #%top-interaction in setup/infotab?

2020-10-07 Thread Matthew Flatt
At Wed, 23 Sep 2020 18:04:01 +, Sage Gerard wrote:
> Is there a security reason behind omitting #%top-interaction from 
> `setup/infotab`?

No, I don't think there is any security issue here. Adding
`#%top-interaction` seems fine.


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/20201007074140.3eb%40sirmail.smtps.cs.utah.edu.


Re: [racket-users] #:kind (list ... ) in defthing and defproc

2020-10-07 Thread Matthew Flatt
A recent commit added a contract on `defthing` and `defproc` to enforce
the documented constraint that `#:kind` should be a string. But the
implementation is happy with content in the sense of `content?`.

Since it's easy to adjust the contract and documentation to restore
this capability, I'll do that, and then this example works again.

Matthew

At Sat, 26 Sep 2020 21:06:20 +0200, Jos Koot wrote:
> The following works well in DrRacket, version 7.8 [3m]
> 
> #lang scribble/manual
> @deftogether[
> (@defthing[#:kind "constant false/on/high" F trit? #:value '0]
>  @defthing[#:kind (list "constant true/off/low" (hspace 1)) T trit? #:value
> '1]
>  @defthing[#:kind "constant indeterminate" ? trit? #:value '?]
>  @defthing[#:kind (list "constant" (hspace 13)) trits (list/c trit? trit?
> trit?) #:value (list F T ?)]
>  @defthing[#:kind (list "constant" (hspace 13)) in-trits sequence? #:value
> (in-list trits)]
>  @defproc[#:kind (list "predicate" (hspace 12)) (trit? (obj any/c))
> boolean?]
>  @defproc[#:kind (list "predicate" (hspace 12)) (F? (obj any/c)) boolean?]
>  @defproc[#:kind (list "predicate" (hspace 12)) (T? (obj any/c)) boolean?]
>  @defproc[#:kind (list "predicate" (hspace 12)) (?? (obj any/c))
> boolean?])]{}
> 
> I use hspace for alignment of the kinds.
> 
> But in version 7.8.0.10--2020-09-25(515012525c/a) [3m] I get:
> 
> . . C:\Program Files\Racket-7.8.0.10\collects\syntax\contract.rkt:101:21:
> defthing: contract violation
>   expected: (or/c string? #f)
>   given: ("constant true/off/low" #(struct:element hspace (" ")))
>   in: (or/c string? #f)
>   macro argument contract on #:kind argument
>   contract from:
>   (lib scribble/private/manual-proc.rkt)
>   blaming: E:\circuits\circuit-manual.scrbl
>(assuming the contract is correct)
>   at: E:\circuits\circuit-manual.scrbl:416.18
> 
> Because I don't know whether or not this is a known issue, I post it on
> this list.
> If this is a known issue or an intentional change, then ignore this email,
> please.
> If not I can post it as a racket issue.
> Let me know, please.
> Thanks, Jos
> 
> -- 
> 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/CAL6KNi3P251G%2BBMQqDbo2qt6K22Gw
> _OOgjjnHDboLLuC3qKrGg%40mail.gmail.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/20201007074018.1a7%40sirmail.smtps.cs.utah.edu.


Re: [racket-users] How to redirect only some library documentation in Scribble

2020-10-07 Thread Matthew Flatt
At Tue, 29 Sep 2020 17:51:42 -0700, "William J. Bowman" wrote:
> I'm writing a large Scribble document which links to package
> documentation. I link to normal Racket documentation, and currently
> redirect those to the main racket-lang documentation using
> --redirect-main "https://docs.racket-lang.org;. But I also link to a
> private library, and would like to redirect references to this
> library's documentation to a separate URL.
> 
> Ideally, I would do this by declaring the root URL for the package, and not by
> manually annotating every usage of @racket[private-library-identifier].
> 
> Is this possible?

As you've no doubt concluded by now, there's not really a way to do
this. It must be technically possible to override methods of the HTML
renderer to make this happen, but it wouldn't be practical.

I'm not sure what a good interface would be for more fine-grained
configuration. If it's worth it to you to look at how HTML renderer
might better support this, look for places in `scribble/html-render`
that use `external-root-url`, since that's what `--redirect-main` turns
into.


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/20201007072437.8d%40sirmail.smtps.cs.utah.edu.