[racket-users] Racket News - Issue 35

2020-07-21 Thread Paulo Matos
Hey all, Issue 35 is here: https://racket-news.com/2020/07/racket-news-issue-35.html Apologies for the slight delay but I started feeling quite poorly yesterday evening as I was about to finish the editing of the issue. Have a great day and Enjoy! Paulo Matos -- You received this message bec

Re: [racket-users] Font bearing - lining up texts and outlines

2020-07-21 Thread Jens Axel Søgaard
Den man. 20. jul. 2020 kl. 19.14 skrev Jens Axel Søgaard < jensa...@soegaard.net>: > Thanks for the response. > > I have attempted to go in your foot steps and have made a single file > example, so it is easy to try out. > Just to recap, the goal is to get the vertical bearing. > > The first step

[racket-users] Re: Removing duplicates from a list while still maintaining order in Dr. Racket.

2020-07-21 Thread Prabhakar Ragde
Could you point us to the original homework question so we can be sure of the requirements? Thanks. On Monday, July 20, 2020 at 12:04:45 PM UTC-4, JJ C wrote: > > In Beginning Student with List Abbreviations > > I am struggling to come up with functions to remove duplicates from a list > while m

Re: [racket-users] Font bearing - lining up texts and outlines

2020-07-21 Thread Matthew Butterick
The `fontland` library does not have an official public API but it will give you the answer, which is 1446. #lang racket (require fontland fontland/ttf-glyph) (define f (open-font "/System/Library/Fonts/Supplemental/Arial Unicode.ttf")) ;; `layout` uses OpenType positioning & substitution tables

[racket-users] combining require, build-path, and namespaces

2020-07-21 Thread Shriram Krishnamurthi
How I can combine these three? I want to do something like this: (define n (make-base-namespace)) (define p (build-path f)) (eval `(require ,p) n) Racket doesn't like that: bad syntax for require sub-form because p is a path-typed value. Essentially, I want to inject the module at f

Re: [racket-users] combining require, build-path, and namespaces

2020-07-21 Thread Jens Axel Søgaard
Den tir. 21. jul. 2020 kl. 17.45 skrev Shriram Krishnamurthi < shri...@gmail.com>: > How I can combine these three? I want to do something like this: > > (define n (make-base-namespace)) > (define p (build-path f)) > (eval `(require ,p) n) > > Racket doesn't like that: bad syntax for r

Re: [racket-users] Creating links to Racket docs for functions in user-scope packages

2020-07-21 Thread 'Joel Dueck' via Racket Users
It looks like the problem might be in this function where it always constructs a path that is relative to (find-doc-dir). Would it make sense instead to have it check the dest against all the paths

Re: [racket-users] combining require, build-path, and namespaces

2020-07-21 Thread Shriram Krishnamurthi
Thank you! Would you know why I might get this error: ; require: unknown module ; module name: ; #> (This is from inside a module.) Trying the same at the REPL, I see the same thing: > (define n (make-base-namespace)) > (namespace-require `(file ,(path->string (build-path "wheats" "w1.

[racket-users] Sending a file descriptor along a socket?

2020-07-21 Thread Christopher Lemmer Webber
It looks like ffi/unsafe/port provides ways to read a file desciptor from a port that is capable of receiving them, and there are tools to transform that file descriptor into a port or the reverse, but is there a way for me to *write* a file descriptor to a port (ie, the equivalent to the sendmsg p

Re: [racket-users] combining require, build-path, and namespaces

2020-07-21 Thread Sorawee Porncharoenwase
This is weird. I usually parameterize current-namespace when using namespace-* functions, and in this particular case it works fine. On Tue, Jul 21, 2020 at 11:05 AM Shriram Krishnamurthi wrote: > Thank you! Would you know why I might get this error: > > ; require: unknown module > > ; module

Re: [racket-users] combining require, build-path, and namespaces

2020-07-21 Thread Jens Axel Søgaard
Den tir. 21. jul. 2020 kl. 20.25 skrev Sorawee Porncharoenwase < sorawee.pw...@gmail.com>: > This is weird. I usually parameterize current-namespace when using > namespace-* functions, and in this particular case it works fine. > > On Tue, Jul 21, 2020 at 11:05 AM Shriram Krishnamurthi > wrote: >

[racket-users] Re: combining require, build-path, and namespaces

2020-07-21 Thread Greg Hendershott
Do you definitely want *only* definitions explicitly provide-ed by the module, or is it acceptable (or even desirable) to see *all* module definitions? If the latter, you could use module->namespace. On Tuesday, July 21, 2020 at 11:45:38 AM UTC-4, Shriram Krishnamurthi wrote: > > How I can comb

[racket-users] Combining generators and typed racket

2020-07-21 Thread Nate Griswold
Do generators and typed racket work together well? It seems (yield) doesn't have a type and i couldn't get my module to work. Is there a way to make some procedure untyped in the middle of a typed file? Is it just best to break these things into separate files? Thank you Nate -- You received t

Re: [racket-users] combining require, build-path, and namespaces

2020-07-21 Thread Shriram Krishnamurthi
Ooh, thank you Oak and Jens Axel! I would never have figured that out. As Matthew's email from Jan 2020 says, having the documentation say something (and, in particular, suggesting the use of `parameterize` to get what many users might expect) would be quite lovely. (Thanks also, Greg.) Shriram

[racket-users] Re: Combining generators and typed racket

2020-07-21 Thread Nate Griswold
Actually, is there any way at all to use lazy lists of things (streams or generators) in typed racket? Nate On Tue, Jul 21, 2020 at 8:45 PM Nate Griswold wrote: > Do generators and typed racket work together well? It seems (yield) > doesn't have a type and i couldn't get my module to work. > >