Hashsets and OpenArrays

2022-09-19 Thread pg13
My use case was Advent of Code 2015 where I have a list of cities to create a route through and I wanted my list of cities to be a hashset (to avoid duplicates) and then permutate all the possible options to calculate distance. >From your response, I understand by definition the hashset can't be

Hashsets and OpenArrays

2022-09-19 Thread pg13
I want to pass a hashset to std/algorithm's nextPermutation and can't because nextPermutation accepts an OpenArray (an array or sequence), but not a hashset. Are my options then: * copy my hashset into a sequence for use with other std/procs that require OpenArray's, or, * don't use hashset

re or nre. What should i use? What will be supported in future?

2022-09-16 Thread pg13
I find nre to be more reliable, as the following code block suggests. import re,nre let re1 = re.re"dd" re2 = nre.re"dd" echo re.match("ugknbfddgicrmopn",re1) echo nre.contains("ugknbfddgicrmopn",re2) false true Run Of course, could be I