Tyoma Makeev
Tyoma Makeev
MModular
Created by Tyoma Makeev on 9/8/2024 in #questions
What's the thing with global variables?
From what I've tried, using the global variables like this
var some_global_var: String = "Hey!"

fn main():
print(some_global_var)
var some_global_var: String = "Hey!"

fn main():
print(some_global_var)
works when you just run your code, but doesn't work in compiled executables. I've seen some folks mentioning this here on this server, but I can't seem to find any relevant docs on this, as well as I don't understand whether it's a bug, or am I supposed to work with global variables somehow differently. Any info on this would help, thanks!
6 replies
MModular
Created by Tyoma Makeev on 9/5/2024 in #community-showcase
Language learning tool: a small Bash script for interactive search over a bunch of Mojo codebases
I put together a Bash script that 1. Downloads a bunch of existing Mojo codebases, 2. Runs The Silver Searcher and FZF so you can do a quick and beautiful full-text search over them. Might be helpful for finding out how other people used this feature/keyword/library/whatever. https://gist.github.com/schtschenok/3c03f8009ae94c296a6447f47d5cc6b4
3 replies