Repository navigation
Beta 0.20.0
Pre-release
Pre-release
This version may in some cases improve performance.
Added
Syntax
- Allow the
+sign in a e-infix expression (such as10e+3)
Flow control
- Add the
break and return (value)syntax, which allows to return a certain value when breaking a loop. - Add loop labels:
- Using the syntax
for:label,while:labelordo:label, you can label your loops. - Using the syntax
break:labelandcontinue:label, you can break or continue an outer loop.
- Using the syntax
Builtins
- Add the
is_objectbuiltin function - Add the
is_constructorbuiltin function
Metas
- Add the
appendNoneOnContinuemeta- Takes no argument
- If enabled, loops will append
Noneto their result if there is acontinue(see the Changed section)
- Add the
appendNoneOnBreakmeta- Takes no argument
- If enabled, loops will append
Noneto their result if there is abreak(see the Changed section)
Command line interface
- Add the
-i(or--interactive) CLI argument. Allows to run an interactive shell after executing
a file, within the context of that file (i.e. with all the variables)
Technical and debug
- Add the
print_timedebug option: adddebug.should_print_time(0 or 1),debug.print_time(),debug.stop_print_time(). This option prints the total time different parts of Nougaro took to complete. [Internal API]AddRecursionError, accessible in libs usingRTRecursionError.[Internal API]Add Library Version, accessible throughsrc.noug_version.LIB_VERSION. It is stored in the key"lib-version"innoug_version.json. It is currently2.
Changed
Syntax
- Numbers can no longer have trailing underscore at the beginning or at the end.
Runtime
- Loops no longer append
Noneto their result if there is acontinueorbreak. UseappendNoneOnContinueandappendNoneOnBreakmetas if you still want to do that. - Rework completely equality and other comparisons to be more consistant
- Functions, built-in functions, methods and module functions can now be equal (if they’re the same)
- Same for objects and constructors
- Strings can now be less than or equal to others, according to the alphabetical order.
For instance,"foo" > "bar", and"hello" < "world". <,<=,>,>=comparisons now crash when used on lists, modules, constructors, objects, any function, None.and,orandxornow works properly with functions, methods, built-in functions
- Functions can now be converted to strings using
str(). - Representation of the
exitbuiltin function is now"Use exit(), CTRL+C (i.e. interrupt) or CTRL+D (i.e. EOF) to exit."instead of"<built-in function exit>".
Technical and debug
debug.enable_all()anddebug.disable_all()now also enable or disable theprint_timedebug option.- Data version has been increased to
6. - Version ID has been increased to
5. [Internal API]It is now possible to compare Nodes and Tokens. Usenode1 == node2ornode1 != node2. Does not checkpos_startandpos_end, so it is better thanhash(node1) == hash(node2).[Build scripts](Linux) The Nougaro version is now automatically fetched.
Writing libraries
- Modules written in Python now need to have a library version (
__LIBRARY_VERSION__). If a module doesn’t have the same
library version as the current Nougaro version, an error is thrown. Library version is currently2. - Libraries now need the
is_eqmethod as described in documentation (TODO: update doc on release – the method is described but in a “in the future you will have to” box).
Removed
- Removed
noug_version.phase_minor. Usenoug_version.release_serialinstead.
Fixed
- Fix position start of constructors in error messages.
10eanystringofcharacters-10is no longer parsed to10e-10, and throws an error instead.- Fix a crash on maximum recursion depth exceeded.
- Fix a bug where you could have two parameters with the same name in a function definition.
- Start and end positions of
xorare now correct. - Accessing a variable no longer return a copy of the value, but directly the value instead. It allows things such as
def return(object)->object; var return(a).b = 4(this previously lefta.bunchanged, it now properly updates it to 4) input_numnow returns an integer if the entered value is an integer, otherwise it returns a float.- Fix a crash when trying to print surrogates unicode characters (within a pair or not)