Re: [racket-users] Semaphore-count

2018-09-07 Thread Craig Allen
Thanks, I will look into this. 

On Thursday, 6 September 2018 03:25:43 UTC+1, gneuner2 wrote:
>
>
> On 9/4/2018 11:46 AM, George Neuner wrote: 
> > 
> > AFAIK there is no way to simply 'check' if the semaphore is available. 
> > 
>
> I was wrong - there is a way using events: semaphore-peek-evt  can check 
> whether a semaphore is ready without affecting its counter. 
>
>
> https://docs.racket-lang.org/reference/semaphore.html?q=semaphore-peek#%28def._%28%28quote._~23~25kernel%29._semaphore-peek-evt%29%29
>  
> 
>  
>
>
> George 
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Build racket failure if I translate the text in racket/share/pkgs/scribble-lib/scribble/private/manual-bind.rkt

2018-09-07 Thread Oling Cat
I'm translating the racket docs into Chinese and made some change in
scribble like this

,
and it will cause follow errors:

raco setup: rendering: /racket-index/scribblings/main/search.scrbl
> make-script: internal error: unexpected tooltip
>   context...:
>
>  
> /home/cat/Source/Racket-zh/racket/pkgs/racket-index/scribblings/main/private/make-search.rkt:116:4:
> for-loop
>
>  
> /home/cat/Source/Racket-zh/racket/pkgs/racket-index/scribblings/main/private/make-search.rkt:64:0:
> make-script
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/base-render.rkt:971:4:
> render-content method in render%
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1528:4:
> render-plain-content method in render-mixin
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/base-render.rkt:971:4:
> render-content method in render%
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1188:4:
> do-render-paragraph method in render-mixin
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1216:4:
> render-intrapara-block method in render-mixin
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/base-render.rkt:917:4:
> render-compound-paragraph method in render%
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1768:4:
> render-compound-paragraph method in render-mixin
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1175:6:
> loop
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1172:4:
> render-flow* method in render-mixin
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1099:4:
> render-part-content method in render-mixin
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:820:4:
> render-one-part method in render-mixin
>loop
>
>  
> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/contract-render.rkt:14:4:
> render method in override-render-mixin
>
>  /home/cat/Source/Racket-zh/racket/pkgs/racket-index/setup/scribble.rkt:1431:3
>...


I'm confusing that why the building will fail if I just replace some ASCII
strings with Unicode string? How to resolve 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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] What does `raco test file.rkt` do by default if no `test` submodule?

2018-09-07 Thread Marc Kaufmann
Thanks Greg and David.

If I use raco test, is the best practice to configure test runs via an 
info.rkt file (I did that when I wanted to exclude files instead of the 
`-x` flag)? Are there any common (best?) practices for racket tests that I 
should be aware of, whether it is purely by convention or because the tools 
tend to work better that way.

David, for now raco test works for my needs, so I'll stick with it. I'll 
keep it in mind though, especially for the feature of printing passing 
tests.

Cheers,
Marc

On Thursday, September 6, 2018 at 5:31:17 PM UTC+2, David K. Storrs wrote:
>
> This isn't a direct answer to your question, but you might want to check 
> out handy/test-more.  Unlike the racket test system it always provides 
> feedback on what tests have run and it will warn you if you did not run the 
> expected number of tests.  It also uses shorter names for the tests and 
> each test returns a useful value so that you can chain tests together or 
> use them in conditionals.  For example:
>
> ;; in test.rkt
> #lang racket
>
> (require handy/test-more)
>
> (when (not (equal? 'windows (is (system-type) 'windows "expected to be 
> running on windows")))
>   (void (is (system-type) 'macosx "it's mac"))
>   )
>
> (test-suite
>  "examples"
>
>  (throws (thunk (raise-arguments-error 'some-func "bad args"))
>  #px"bad args"
>  "threw as expected")
>
>  (lives (thunk (ok 1 "1 is true"))
> "checking truth of 1 did not blow up")
>  )
>
>
>
> ;; at command line (assume you're running on macOS)
> $ racket test.rkt
>
> NOT ok 1 - expected to be running on windows
>   Got:  'macosx
>   Expected: 'windows
> ok 2 - it's mac
>  (START test-suite:  examples)
> ok 3 - threw as expected
> ok 4 - 1 is true
> ok 5 - checking truth of 1 did not blow up
> ok 6 - test-suite completed without throwing uncaught exception
>
> Total tests passed so far: 5
> Total tests failed so far: 1
>  (END test-suite:  examples)
> WARNING: Neither (expect-n-tests N) nor (done-testing) was called.  May 
> not have run all tests.
>
>
>
> There's thorough documentation, although it's in comments instead of in 
> Scribble so you'll need to actually look in the code.  I keep meaning to 
> Scribbleify it but haven't found the tuits.  I also have chosen not to have 
> a handy/main.rkt that would pull in all the pieces of handy, since I feel 
> like it's better to be explicit about what you want.  If people actually 
> started using it and asked for that feature then I'd add it.
>
>
> On Thu, Sep 6, 2018 at 5:46 AM, Marc Kaufmann  > wrote:
>
>> Hi,
>>
>> I am starting to use raco test for testing, and found out that in a file 
>> without (module test ...), it may run some kind of test on the file. But 
>> for some files, raco test reports that it ran a test, for others however no 
>> test is run.
>>
>> Right now I am now adding a (module test racket/base) at the end of files 
>> I have no tests for which leads to 0 tests (as it should). Nonetheless out 
>> of curiosity, I am wondering why raco reports running a test for 
>> `pages.rkt`, but not `tools.rkt`, even though both of them are essentially 
>> defining a bunch of functions and providing them to other files, without 
>> running any code.
>>
>> This made me realize that I don't know how to print out which tests were 
>> run. Is there a way of doing that?
>>
>> Thanks,
>> Marc
>>
>> -- 
>> 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...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.