Stream: beginners

Topic: ✔ I must be missing something obvious...


view this post on Zulip Ian McLerran (Jan 09 2025 at 18:02):

So I wanted to add a walk_try! function to the roc List module. I built roc with cargo build --release without issue. I then built the snake_case_builtins version of basic-cli from source, and tried to write a simple roc program using walk_try!. However, roc throws a compile error saying that List does not expose walk_try!.

which roc verifies that I am using <path_to_repo>/target/release for my roc binary. I'm sure I must be missing something obvious - any ideas why roc might say the function isn't exposed?

Screenshot 2025-01-09 at 11.13.40.png
Screenshot 2025-01-09 at 11.18.08.png

view this post on Zulip Sam Mohr (Jan 09 2025 at 18:03):

Yep, builtins also need to be added to a Rust file

view this post on Zulip Sam Mohr (Jan 09 2025 at 18:04):

https://github.com/roc-lang/roc/blob/158691fb27649e3b6cfb3d2c0c4a6d1434bcbd20/crates/compiler/module/src/symbol.rs#L1422

view this post on Zulip Ian McLerran (Jan 09 2025 at 18:12):

Ahah! Thanks Sam, does it matter what number I assign to LIST_WALK_TRY_FX? Should I just assign it the next available number (95)?

view this post on Zulip Brendan Hansknecht (Jan 09 2025 at 18:13):

Yeah

view this post on Zulip Brendan Hansknecht (Jan 09 2025 at 18:13):

Next available

view this post on Zulip Brendan Hansknecht (Jan 09 2025 at 18:13):

Unless you want to organize it a specific way and renumber everything to insert it in a specific location (don't recommend, but occasionally nice to group things)

view this post on Zulip Ian McLerran (Jan 09 2025 at 18:15):

That's what I figured, but thought I should confirm there wasn't an deliberate order.

view this post on Zulip Notification Bot (Jan 09 2025 at 20:15):

Ian McLerran has marked this topic as resolved.


Last updated: Jul 06 2025 at 12:14 UTC