# Ffi libs and raco setup info.rkt

**URL:** <https://racket.discourse.group/t/ffi-libs-and-raco-setup-info-rkt/2974>\
**Category:** Questions & Answers\
**Created:** [June 21, 2024, 4:59pm UTC](https://racket.discourse.group/t/ffi-libs-and-raco-setup-info-rkt/2974 "2024-06-21T16:59:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matteo-daddio](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/matteo-daddio/32/1245_2.png) [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Post date:** [June 21, 2024, 4:59pm UTC](https://racket.discourse.group/t/ffi-libs-and-raco-setup-info-rkt/2974/1 "2024-06-21T16:59:43Z")

</div>

Hello,

I need to develop a ffi and I read _The Racket Foreign Interface_. Now I’m trying to understand how to install the correct libraries for each supported operating systems and I’m reading the Raco setup documentation.  
There’s a thing I don’t understand:

 ![IMG_3982](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/7/71bfbeeae7f2e0ad3fdacdaffc1b45e0953b6e6c.jpeg)

The underlined code is _and/c_ or _or/c_?

Matteo

---

<div class="post-metadata">

**Author:** ![sorawee](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@sorawee](https://racket.discourse.group/u/sorawee)\
**Post date:** [June 21, 2024, 8:30pm UTC](https://racket.discourse.group/t/ffi-libs-and-raco-setup-info-rkt/2974/2 "2024-06-21T20:30:10Z")

</div>

It’s `and/c`.

The function `relative-path?` itself has the contract `(or/c path? string? path-for-some-system?) -> boolean?`. Because of this, an expression like `(relative-path? 1)` results in an error, not false. So `relative-path?` alone cannot be used as a contract that works on all values.

The workaround here is to use `and/c` to short-circuit (in the same way that `and` does).

- If the input to `(and/c path-string? relative-path?)` is a `path-string?`, then `relative-path?` is used for the contract behavior.
- If the input to `(and/c path-string? relative-path?)` is not a `path-string?`, then `relative-path?` is not used at all. The whole contract short-circuits and doesn’t satisfy the input.

---

<div class="post-metadata">

**Author:** ![matteo-daddio](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/matteo-daddio/32/1245_2.png) [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Post date:** [June 22, 2024, 10:30am UTC](https://racket.discourse.group/t/ffi-libs-and-raco-setup-info-rkt/2974/3 "2024-06-22T10:30:10Z")

</div>

Thank you, very interesting.
