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
Copy file name to clipboardExpand all lines: website/Space Lua.md
+13-4Lines changed: 13 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,8 @@ A new syntax introduced with Space Lua is the `${lua expression}` syntax that yo
57
57
58
58
For example: 10 + 2 = ${adder(10, 2)} (Alt-click, or select to see the expression) is using the just defined `adder` function to this rather impressive calculation.
59
59
60
+
Note that you can have the text {lua expression} in your page and it won't be evaluated. So writing `${"$"}{lua expression}` can be used to “delay” evaluation by one pass, for example to escape expressions in templated content.
61
+
60
62
## Queries
61
63
Space Lua has a feature called [[Space Lua/Lua Integrated Query]], which integrate SQL-like queries into Lua. Here’s a small example querying the last 3 modifies pages:
62
64
@@ -127,10 +129,17 @@ There's a magic `_CTX` global variable available from which you can access usefu
127
129
# Lua implementation notes
128
130
Space Lua is intended to be a more or less complete implementation of [Lua 5.4](https://www.lua.org/manual/5.4/). However, a few features are (still) missing:
129
131
130
-
*`goto` and labels (not planned, goto considered harmful)
131
-
* coroutines (not planned, not useful in the SilverBullet context)
132
-
*_ENV (planned)
133
-
* Full metatable support (only partial now, planned)
132
+
## Differences
133
+
* empty table `{}` tests false, while in [Lua 5.4](https://www.lua.org/manual/5.4/manual.html#3.3.4) "All values different from **nil** nad **false** test true". However this has a really nice interaction with empty [[Space Lua/Lua Integrated Query|query]] results
134
+
135
+
## Planned
136
+
*_ENV
137
+
* Full [metatable](https://www.lua.org/manual/5.4/manual.html#2.4) support (only partial now)
138
+
* Complete [[API/string]] API (some patterns in `gmatch` don’t work correctly)
139
+
140
+
## Not planned
141
+
*`goto` and labels (goto considered harmful)
142
+
* coroutines (not useful in the SilverBullet context)
134
143
* Hexadecimal numeric constants with a fractional part, or binary exponents (not supported by JavaScript number parser either)
0 commit comments