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
692bb521ece6450070277ea9cd03fab630996769
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: 36ms Template: 3ms
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