Up to Main Index Up to Journal for September, 2022
JOURNAL FOR SATURDAY 3RD SEPTEMBER, 2022
______________________________________________________________________________
SUBJECT: Mere v0.0.2, now with arrays
DATE: Wed 31 Aug 21:31:37 BST 2022
I’ve just updated Mere & Mere ICE in the annexed works[1] to v0.0.2 for people
to play with. The changes include support for int, float, string and bool
arrays. There is a new delete built-in to remove array elements or clear all
array elemets. A few new operators: << >> ^ and ^=. Two new code examples have
been added: a linear feedback shift register (LFSR) — used in pseudo-random
number generation — and a simple, inefficient, bubble sort.
Based on user feedback, the syntax for arrays has been modified. The square
brackets were after the type, they are now before the type. Instead of “int[]”
being read as “an integer array” we have “[]int” which reads as “an array of
integers”. For example:
x:[]int ;# define x as an array of ints
x = []int 1 2 3 ;# populate x with an array of ints [1 2 3]
x:[]int = []int 1 2 3 ;# OR define and assign together
As always, comments and feedback on Mere are welcome: diddymus@wolfmud.org
From the Mere ICE “What’s New” section:
• New bubble sort example showing array usage.
• New delete built-in to remove array elements and clear arrays.
• Support for int, float, string and bool arrays.
• New linear feedback shift register (LFSR) example showing ^, << and >>
operator usage.
• New <<, >>, ^ and ^= operators.
• trace built-in no longer requires a dummy parameter to retrieve the
current tracing state.
• Improved documentation.
• Improved parameter handle for built-ins.
--
Diddymus
[1] ../../../annex
Up to Main Index Up to Journal for September, 2022