Feedback for documentation inconsistencies and unnoticed bugs #71
Replies: 56 comments 49 replies
-
Because |
Beta Was this translation helpful? Give feedback.
-
I guess the documentation needs a bit of clarification, because in the screenshot below this is what we currently see: I just follow the documentation to understand the language in detail. |
Beta Was this translation helpful? Give feedback.
-
Oh, it's a mistake in the documentation. |
Beta Was this translation helpful? Give feedback.
-
I see. Well, just add a |
Beta Was this translation helpful? Give feedback.
-
By the way @edubart can we transfer this to Discussion? I will be testing the whole docs and in case I find other buggy code samples, I will be reporting it there instead of opening multiple tickets. Is that OK with you? |
Beta Was this translation helpful? Give feedback.
-
Yes, I am ok with this, continue posting here any mistake you find in the documentation. |
Beta Was this translation helpful? Give feedback.
-
Thank you @edubart |
Beta Was this translation helpful? Give feedback.
-
In reality it prints |
Beta Was this translation helpful? Give feedback.
-
In local function poll_events()
local event: SDL_Event
while SDL_PollEvent(event) ~= 0 do
switch event.type
case SDL_QUIT then
return false
end
end
return true
end but in docs we have Is |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
I've fixed the following things you mentioned in the documentation:
Thanks for reporting these inconsistencies, once you feel there is nothing more wrong in the documentation you can close this issue. |
Beta Was this translation helpful? Give feedback.
-
Sure thing @edubart, I currently work on implementing syntax highlighting for Vim editor which I use and it's a nightmare 😄 that's why I report all these inconsistencies; I'm trying to make it work as expected. As soon as I feel it's ready I will create a repo around it for people to use it and provide feedback accordingly. |
Beta Was this translation helpful? Give feedback.
-
If you are working on a syntax highlighter plugin I highly recommend using the compiler PEG grammar as reference that just shipped the master branch a few hours ago. This file: https://github.com/edubart/nelua-lang/blob/master/nelua/syntaxdefs.lua#L14 You can read the full syntax definition in a compact form there as reference (assuming you understand LPEG's re syntax). |
Beta Was this translation helpful? Give feedback.
-
Very nice! I will double-check everything right now; thank you for the feedback. Vimscript's syntax is pure...magic? Yeah, I think you understand what I mean 😑 |
Beta Was this translation helpful? Give feedback.
-
I have found two types that are undocumented: |
Beta Was this translation helpful? Give feedback.
-
I'm almost done with
About the last one, can you please explain to me how the following code actually returns its result as argument? local function g(x: integer, f: function(x: integer): integer)
-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
return f(x)
end
local y = g(1, function(x: integer): integer
return 2*x
end)
print(y) -- outputs: 2 Is there an implicit return mechanism that takes place, like ECMAScript's Lambda Expression Update: To resolve the issue with lambda functions, all I need to add is an |
Beta Was this translation helpful? Give feedback.
-
When you find time, can you please provide some new examples based on primitive numeric types' suffixes? Preferably for
|
Beta Was this translation helpful? Give feedback.
-
@edubart this is to announce the release of nelua.vim. It's not ready yet, but it's usable at 95% of it. If you know any Vim expert, please let him know about the syntax highlighting project as I need advice and feedback. |
Beta Was this translation helpful? Give feedback.
-
@edubart was there any change in Importing C functions declared in headers ? This is what the example shows it generates, this is what I get as C code: This is of course a lot better than the showed example in overview. |
Beta Was this translation helpful? Give feedback.
-
What is "foo"'s meaning supposed to be? |
Beta Was this translation helpful? Give feedback.
-
I get |
Beta Was this translation helpful? Give feedback.
-
For output I get |
Beta Was this translation helpful? Give feedback.
-
So, an interesting behavior is happening with Nelua. In the directory I work I have named a module Isn't there a namespace approach to look for the system modules first and then for a user's modules, much like we have in C with |
Beta Was this translation helpful? Give feedback.
-
In FAQ Why does Nelua compile to C first? we have the following bullet list
Can we add a star that clarifies the use of metaprogramming? As far as I can tell, the preprocessing magic is not included in generated C code, therefore it could give the false impression of "write whatever you like in Nelua, metaprogramming included, and will be generated as C code". If I got it wrong please enlighten me @edubart. |
Beta Was this translation helpful? Give feedback.
-
My output is |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
In Preprocessor macros emitting AST nodes, can you add the following code at the end of it to make it obvious of what it actually generates? local a = #[create_sequence(integer, 10)]#
for i=0,<#a do
print(i,a[i])
end |
Beta Was this translation helpful? Give feedback.
-
Congrats on breaking a new compile-time record! That's the |
Beta Was this translation helpful? Give feedback.
-
@edubart if I wanted to add inline assembly in my Nelua code, how would I do that? Is it something I can do via metaprogramming? |
Beta Was this translation helpful? Give feedback.
-
Output in https://github.com/edubart/nelua-lang/blob/master/docs/pages/overview.md#preprocessing-polymorphic-functions shows different result than mine. I get |
Beta Was this translation helpful? Give feedback.
-
In Global Symbol of documentation, we have the following example:
This throws an error when called:
If I add
return 'f'
insideglobal_f()
, I get the desired output.What is the behavior we initially expected in the first place?
Beta Was this translation helpful? Give feedback.
All reactions