Mojo 是一种新的编程语言,我们是国内第一批 Mojo 开发 者。
本项目由Mojo中文网发起,旨在学习Mojo语言和翻译Mojo文档,致力于让更多开发者参与交流。
⚡欢迎各位开发者加群 摸鱼 交流。
Wechat & Telegram
Mojo_CN by 影象限,shadowq, MojoCN, Mojoo is licensed under CC BY-NC-ND 4.0
Mojo编程语言的学习资料、开源社区、中文网站。
Home Page: https://mojocn.org
License: Other
参数化函数 中的第一个例子显示问题, 应为:
fn repeat[count: Int](msg: String):
@unroll
for i in range(count):
print(msg)
后面的repeat[3]()
也应为repeat[3]("Hello")
.
https://mojocn.org/docs/chat.html
404: Page Not Found
CN-demo: self&
struct MyPair:
var first: Int
var second: Int
# We use 'fn' instead of 'def' here - we'll explain that soon
fn __init__(self&, first: Int, second: Int):
self.first = first
self.second = second
fn __lt__(self, rhs: MyPair) -> Bool:
return self.first < rhs.first or
(self.first == rhs.first and
self.second < rhs.second)
mojo-demo: inout self
struct MyPair:
var first: Int
var second: Int
# We use 'fn' instead of 'def' here - we'll explain that soon
fn __init__(inout self, first: Int, second: Int):
self.first = first
self.second = second
fn __lt__(self, rhs: MyPair) -> Bool:
return self.first < rhs.first or
(self.first == rhs.first and
self.second < rhs.second)
kong-lingran@kong-lingran-None:~$ curl -s https://mojocn.org/get.sh | sh -
[sudo] kong-lingran 的密码:
Executing the setup script for the 'modular/installer' repository ...
OK: Checking for required executable 'curl' ...
OK: Checking for required executable 'apt-get' ...
OK: Detecting your OS distribution and release using system methods ...
^^^^: ... Detected/provided for your OS/distribution, version and architecture:
:
: ... distro=ubuntu version=23.10 codename=mantic arch=x86_64
:
OK: Checking for apt dependency 'apt-transport-https' ...
OK: Checking for apt dependency 'ca-certificates' ...
OK: Checking for apt dependency 'gnupg' ...
OK: Checking for apt signed-by key support ...
OK: Importing 'modular/installer' repository GPG keys ...
OK: Checking if upstream install config is OK ...
OK: Installing 'modular/installer' repository via apt ...
NOPE: Updating apt repository metadata cache ...
Failed to update via apt-get update
命中:1 http://mirrors.aliyun.com/ubuntu mantic InRelease
命中:2 https://mirrors.aliyun.com/docker-ce/linux/ubuntu mantic InRelease
命中:3 http://mirrors.aliyun.com/ubuntu mantic-updates InRelease
命中:4 http://mirrors.aliyun.com/ubuntu mantic-backports InRelease
命中:5 http://security.ubuntu.com/ubuntu mantic-security InRelease
获取:6 https://dl.modular.com/public/installer/deb/ubuntu mantic InRelease [3,674 B]
命中:7 https://packages.microsoft.com/ubuntu/23.10/prod mantic InRelease
获取:8 http://repo.mysql.com/apt/debian jessie InRelease [28.8 kB]
获取:9 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease [3,632 B]
错误:8 http://repo.mysql.com/apt/debian jessie InRelease
下列签名无效: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering [email protected]
错误:9 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease
由于没有公钥,无法验证下列签名: NO_PUBKEY EB3E94ADBE1229CF
正在读取软件包列表...
W: http://repo.mysql.com/apt/debian/dists/jessie/InRelease: 密钥存储在过时的 trusted.gpg 密钥环中(/etc/apt/trusted.gpg),请参见 apt-key(8) 的 DEPRECATION 一节以了解详情。
W: GPG 错误:http://repo.mysql.com/apt/debian jessie InRelease: 下列签名无效: EXPKEYSIG 8C718D3B5072E1F5 MySQL Release Engineering [email protected]
E: 仓库 “http://repo.mysql.com/apt/debian jessie InRelease” 没有数字签名。
W: GPG 错误:https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY EB3E94ADBE1229CF
E: 仓库 “https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease” 没有数字签名。
^^^^: ... Failed to update via apt-get update - Context above (maybe no packages?).
!!!!: Oh no, your setup failed! :-( ... But we might be able to help. :-)
!!!!:
!!!!: You can contact Modular for further assistance.
!!!!:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.