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
Under certain debugging circumstances it is useful to know exactly where a program is in a file. For this we propose a builtin variable: __lineinfo__. A user can read this variable to obtain a (module name, lineno) pair,
let (mod,ln) = __lineinfo__.
The variable mod will be instantiated with the module name as an Asteroid string and the variable will be associated with an integer value representing the current line number.
Does it make sense to have a function that does the opposite; setting the module name and the line number? E.g.,
__set_lineinfo__ (new_mod_name, n).
The text was updated successfully, but these errors were encountered:
Does it make sense to have a function that does the opposite; setting the module name and the line number?
This is tricky! Lineinfo to me seems more like an observation of state than a mutable object, if that makes sense. So initially I don't think it would make sense to have it but at the same time it might be nice to have in some situations? Maybe for a future testing framework or for more meta asteroid-within-asteroid stuff? Not sure!
The reason why I ask that question is because the C compiler supports line directives. The C compiler could be compiling one file and you can make it think it compiles another. The reason being that it needs to support the C preprocessor...
I don't know if it makes sense to have this in Asteroid...but then, why not...
Under certain debugging circumstances it is useful to know exactly where a program is in a file. For this we propose a builtin variable:
__lineinfo__
. A user can read this variable to obtain a (module name, lineno) pair,The variable
mod
will be instantiated with the module name as an Asteroid string and the variable will be associated with an integer value representing the current line number.Does it make sense to have a function that does the opposite; setting the module name and the line number? E.g.,
The text was updated successfully, but these errors were encountered: