Up to Main Index Up to Journal for August, 2023 JOURNAL FOR SUNDAY 6TH AUGUST, 2023 ______________________________________________________________________________ SUBJECT: Mere ICE updated to v0.0.4 DATE: Sun 6 Aug 20:03:32 BST 2023 Yesterday I heard the sad news that Bram Moolenaar, the creator of Vim, had passed away at the age of 62. I’ve used Vim every day for over three decades. Bram, you will be missed, condolences to your family and friends… Mere ICE has been updated to v0.0.4 in the annexed works[1]. This update comes three weeks after the v0.0.3 release. Mere now supports user defined functions with named parameters and multiple return values. A new multiple assignment operator ‘><’ has been added. For-next loops supporting break and continue (with nested loop support) have been added. Some, but not all, examples have been updated to use functions and for-next loops. Reference sections have been added for: break, call, continue, endfunc, for, func, next and return. There are also seven new topics: - Functions¹ - Function Scope¹ - ‘new’ Variable Scope¹ - Overriding Functions/Subroutines¹ - Loops and Iterating - More Loops And Iterating - More Continue And Break ¹ Oops… missed these four topics on the release notes :( NOTE: Existing Mere programs using subroutines need to be updated to use ‘endsub’ instead of ‘return’ as ‘return’ has been repurposed for functions. Apologies for the inconvenience. I really hate breakage but in this case it was unavoidable and made Mere a better language :( NOTE: Please make sure the version in the top right of Mere ICE shows ‘v0.0.4’ and if not hard refresh the web page in your browser. One last minute change sneaked in yet again. The break and continue statements now work with nested for-next loops: target = 189 for x = 1; x <= 10; x+=2 for y = 1; y <= 10; y+=2 for z = 1; z <= 10; z+=2 if x*y*z != target; continue println x "*" y "*" z "=" target break 2 next next next println "Done" From the “What’s New” section: v0.0.4 — Sunday 6th August, 2023 ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ • Subroutines now use ‘endsub’ instead of ‘return’ to return to the caller. All examples and documentation updated. • Functions have been added. Functions are defined using ‘func’ / ‘endfunc’ and may have named parameters. • The ‘return’ built-in can terminate execution of a function before the ‘endfunc’ is reached. Optionally with return values. • New built-in ‘call’ added to execute functions. • A multiple assignment ‘><’ built-in has been added. • Functions, variables and labels now have scope. • Type now returns ‘label’ if variable holds a label, subroutine label or function label. • Added a ‘new’ token for defining a variable in the current scope. IMPORTANT: new should not be used outside of functions, in the global scope or within subroutines - nested or not. • Added for-next loops, with break and continue, support. Reference section added for each. • Added new sections: - Loops and Iterating - More Loops And Iterating - More Continue And Break • Updated “A mere functional dice roller” to use for-next loops. • Updated “A mere multiplication table” to use functions and for-next loops. • Updated “A mere ASCII table” to use for-next loops. • Added reference section for reserved keywords and characters. As always, if you find any bugs or have problems or suggestions then please drop me a quick email: diddymus@wolfmud.org Please… if you find problems, the documentation is unclear or lacking then let me know so that I can do something about it. -- Diddymus [1] The annexed works: /annex/ Up to Main Index Up to Journal for August, 2023