
@jbclements rsound
seems to be looking in the wrong place on my system (Ubuntu 20.04): $ racket
Welcome to Racket v7.9.0.3 [cs].
> (require rsound)
; ffi-lib: could not load foreign library
; path: callbacks.so
; system error: callbacks.so: cannot open shared object file: No such file or
; directory
Although portaudio is installed: $ locate callbacks.so
/home/laurent/.racket/snapshot/pkgs/portaudio/portaudio/lib/i386-linux/3m/callbacks.so
/home/laurent/.racket/snapshot/pkgs/portaudio/portaudio/lib/x86_64-linux/3m/callbacks.so
I tried to see where in rsound this is requested but didn’t find a relevant line

Found it! The embedded libraries are only in the 3m
path, but i’m on CS. Changing the 3m
to cs
in the path above worked for me.

Same thing with buffer-add.so
. I’ll post an issue on both portaudio and rsound

~Could there be a reason making (flush-output)
not flush immediately to disk in a single-threaded program? (linux)~

It’s in the middle of a compute-heavy loop. Any way to actually force a flush?

Can I assume that (current-memory-use)
is only a lookup operation? (i.e., no time-consuming computation)

I could track down to here: https://github.com/racket/racket/blob/8305e5eaef86a356b8fe4cf2e2e52e15789ef9bd/racket/src/ChezScheme/s/7.ss#L69 but after that I don’t know

Note that if you have errortrace enabled, you can get better context information via continuation marks.

The reason that contract-out
and define/contract
differ here is that define/contract
creates a contract between the immediate context and the value being defined, not between the value and the place the value is used.

You could imagine a version of define/contract
that worked somewhat like contract-out
, and there are easier and harder ways to do that. If you wanted the easy-but-inefficient way, just making it a macro that expands to a use of contract
would be simple.

Also I see the same error messages with ->i
when I test it out:

[samth@huor:~/sw/plt (master) plt] r /tmp/b.rkt
f: contract violation
expected: number?
given: "x"
in: the x argument of
(->i ((x number?)) (res (x) (>/c x)))
contract from: (/tmp/b.rkt m1)
blaming: /tmp/b.rkt
(assuming the contract is correct)
at: /tmp/b.rkt:4.26
context...:
/home/samth/sw/plt/racket/collects/racket/contract/private/blame.rkt:347:0: raise-blame-error
/home/samth/sw/plt/racket/collects/racket/contract/private/arr-i.rkt:976:19: /tmp/b.rkt:4:28
body of "/tmp/b.rkt"
[samth@huor:~/sw/plt (master) plt] r /tmp/b.rkt
g: contract violation
expected: number?
given: "x"
in: the 1st argument of
(-> number? number?)
contract from: (/tmp/b.rkt m1)
blaming: /tmp/b.rkt
(assuming the contract is correct)
at: /tmp/b.rkt:5.26
context...:
/home/samth/sw/plt/racket/collects/racket/contract/private/blame.rkt:347:0: raise-blame-error
/home/samth/sw/plt/racket/collects/racket/contract/private/arrow-val-first.rkt:486:18
body of "/tmp/b.rkt"

oh, hmm, I may have misremembered. I’ll pay some more attention in the future in case there’s something else going on (or in case I made it up)

thank you for checking

Yes, turns out there’s one good reason: Placing it at the wrong place and keeping believing it’s at the right place when reading the code…

Yes, it’s fast.

Fantastic, thanks

I use it for course Web pages, textbooks that I write, and slides for presentation.

What is the correct way to disable certain syntax, if there’s no reader parameter for it? For example, if I wanted to disable prefab struct syntax?