Stream: beginners

Topic: Syntax error in the tutorial?


view this post on Zulip Matthieu Pizenberg (May 08 2024 at 21:09):

Hey, I’m trying the tutorial and when saving the following in zed:

app "cli-tutorial"
    packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.10.0/vNe6s9hWzoTZtFmNkvEICPErI9ptji_ySjicO6CkucY.tar.br" }
    imports [pf.Stdout]
    provides [main] to pf

main =
    Stdout.line! "Hello, World!"

it removes a lot of stuff and does not work anymore. I have to write the following instead:

app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.10.0/vNe6s9hWzoTZtFmNkvEICPErI9ptji_ySjicO6CkucY.tar.br" }

import pf.Stdout
import pf.Task

main =
    Stdout.line! "Hello, World!"

I just installed roc and zed today, so I guess they are up-to-date? and the docs are not? Or is it an issue with the language server in zed?

view this post on Zulip Richard Feldman (May 08 2024 at 21:11):

oh yeah we need to update the tutorial to the new import syntax, oops! :sweat_smile:

view this post on Zulip Agus Zubiaga (May 09 2024 at 11:26):

The old headers are supposed to be upgraded fully to the new syntax, but your comment made me realize that we weren't properly doing so when running the formatter through the language server. This PR will fix that.


Last updated: Jul 05 2025 at 12:14 UTC