Logo
Explore Help
Sign In
intercal/not-python
1
0
Fork 0
You've already forked not-python
Code Issues Pull Requests Releases Wiki Activity
Files
e2c84ba7c233ca1254098e34d628db2b2fe6c3a9
not-python/examples/expr.not

14 lines
196 B
Plaintext
Raw Normal View History

Add function expr parsing * Introduce new `fn` keyword * Function example is added to examples/expr.not Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-09-18 16:39:06 -07:00
# pow = fn (n, p) {
# if p == 0 {
# 1
# } else {
# n * pow(n, p - 1)
# }
Add hypothetical "pow" function syntax includes function declaration syntax + ternary expression syntax Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-09-17 13:31:41 -07:00
# }
Add rerun_except crate, and small example code * rerun_except will ensure a build doesn't rerun if a *.not file is modified, which it would otherwise do * Add examples/expr.not with some basic assignment statements and function calls Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-09-17 13:26:38 -07:00
kilo = pow(2, 10)
mega = pow(2, 20)
giga = pow(2, 30)
tera = pow(2, 40)
peta = pow(2, 50)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.5 Page: 74ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API