You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example code given in the REPL help uses let, which causes it to fail. See :mojo help repl
Steps to reproduce
Welcome to Mojo! 🔥
Expressions are delimited by a blank line.
Type `:quit` to exit the REPL and `:mojo help` for further assistance.
1> :mojo help repl
The Mojo REPL (Read-Eval-Print-Loop) acts like an
interpreter of Mojo expressions, which are delimited by a
blank line. These expressions can define top-level
variables, functions, structs, and other declarations, which
are persisted across expressions. For example:
1> let my_var = "Welcome to Mojo!"
2.
2> print(my_var)
3.
Welcome to Mojo!
Besides that, it is possible to execute Python expressions
using the %%python magic, which offers seamless interop with
Mojo code, including exposing top-level python declarations
in subsequent Mojo expressions. For example:
1> %%python
2> import sys
3> print("Python version from python:", sys.version)
4.
Python version from python: 3.11.4
5> print("Python version from Mojo:", sys.version)
6.
Python version from Mojo: 3.11.4
As the Mojo REPL is based on LLDB, the complete set of LLDB
debugging commands is also available as described below.
Commands must be prefixed with a colon at the REPL prompt
(:quit for example).
Typing just a colon followed by return will switch to the
LLDB prompt.
Type "< path" to read in code from a text file "path".
Finally, we encourage you to submit feature requests and error reports in
https://github.com/modularml/mojo/issues.
1> let my_var = "Welcome to Mojo!"
2.
[User] error: Expression [0]:1:1: use of unknown declaration 'let'
let my_var = "Welcome to Mojo!"
^~~
[User] error: Expression [0]:1:5: statements must start at the beginning of a line
let my_var = "Welcome to Mojo!"
^
expression failed to parse (no further compiler diagnostics)```
### System information
```shell
- What OS did you do install Mojo on ?
macOS Sonoma 14.6 (23G80)
- Provide version information for Mojo by pasting the output of `mojo -v`
mojo 24.4.0 (2cb57382)
- Provide Modular CLI version by pasting the output of `modular -v`
modular 0.9.1 (3460d12e)
The text was updated successfully, but these errors were encountered:
Bug description
The example code given in the REPL help uses
let
, which causes it to fail. See:mojo help repl
Steps to reproduce
The text was updated successfully, but these errors were encountered: