So I have this snippet pinched from Rosetta Code:
(define-syntax-rule (define/atomic (name arg ...) body ...)
(define name
(let ([sema (make-semaphore 1)])
(lambda (arg ...)
(dynamic-wind (lambda () (semaphore-wait sema))
(lambda () body ...)
There's no `semaphore-count`, but you can use `semaphore-try-wait?` to
poll a semaphore instead of blocking.
At Tue, 4 Sep 2018 04:47:46 -0700 (PDT), Craig Allen wrote:
> So I have this snippet pinched from Rosetta Code:
>
> (define-syntax-rule (define/atomic (name arg ...) body ...)
> (define
I saw that function, but was scared off by its documentation:
Like semaphore-wait, but semaphore-try-wait? never blocks execution. If sema’s
internal counter is zero, semaphore-try-wait? returns #f immediately
without decrementing the counter. If sema’s counter is positive, it is
decremented an
Hi! I'm new to scribble and try to fix keywords that are underlined in
red. My package is called appy and appy/gui. These export all classes
and other bindings of the package.
In the scribble document I tried both:
@(require (for-label racket)
(for-label "../gui.rkt"))
and
@(require
Have you used `defmodule` or `declare-exporting`?
-Philip
On Tue, Sep 4, 2018 at 8:28 AM Erich Rast wrote:
> Hi! I'm new to scribble and try to fix keywords that are underlined in
> red. My package is called appy and appy/gui. These export all classes
> and other bindings of the package.
>
> I
Nevermind, I've got it working.
I used the wrong for-label require after defmodule - with a relative
path instead of an absolute path, as the manual says. It works fine now.
Best,
Erich
On Tue, 4 Sep 2018 14:28:20 +0100
Erich Rast wrote:
> Hi! I'm new to scribble and try to fix keywords that
On 9/4/2018 8:31 AM, Craig Allen wrote:
I saw that function, but was scared off by its documentation:
Like semaphore-wait, but semaphore-try-wait? never blocks execution.
If sema’s internal counter is zero, semaphore-try-wait? returns #f
immediately without decrementing the counter. If sema’s
Say I have this (possibly from a third-party module):
(define/contract (foo arg) (-> string? #t) #t)
I want to ensure that the argument is always non-empty, so I tighten the
contract. I could do this:
(set! foo (contract (-> non-empty-string? #t) foo 'foo 'neg))
Mutating the function is pr
Is there a way to control what version of `#%module-begin` is introduced
for a `module+` submodule?
I have a DSL that is implemented by doing some fairly strange things with
`#%module-begin`, but I want to reuse `module+` in the DSL. The submodules
should be able to see all of the bindings from th
On Tue, Sep 4, 2018 at 8:55 PM, Matthew Butterick wrote:
>
> On Sep 4, 2018, at 3:54 PM, David Storrs wrote:
>
> Say I have this (possibly from a third-party module):
>
> (define/contract (foo arg) (-> string? #t) #t)
>
> I want to ensure that the argument is always non-empty, so I tighten the
Inspired by
https://groups.google.com/d/msg/racket-users/H7vilh3KcD4/WoKcRUXe-PAJ, I
have a strange but simple workaround. Essentially, I added a module like:
#lang racket
(require syntax/parse/define)
(provide (rename-out
[child-module+ module+]
[child-module* module*]))
(defi
11 matches
Mail list logo