gherkin icon indicating copy to clipboard operation
gherkin copied to clipboard

any way to support older shells?

Open ritschwumm opened this issue 10 years ago • 2 comments

i've been toying with a similar idea, but due to portability issues, i'd not want to depend on bash v4. ideally, plain bourne shell would be nice - but even some older bash version so i don't have to install third-party software on the mac would be nice.

so, where does gherkin depend on features only supported in bash v4?

ritschwumm avatar Dec 08 '14 03:12 ritschwumm

I feel your pain. I'm on a Mac as well. Bash 4 was easy to install, but it kind of defeats the purpose of Gherkin if you need to install software to make it work.

Gherkin's entire memory-management is based on mapping strings (actually, they're more like strings that hold binary data) to data. i.e. associative arrays. These were introduced in Bash4.

I haven't looked for a while, so there may be things I'm forgetting, but IIRC the main reason for the binary data is to encode the datatype. It might be possible to provide each data type with its own numerically indexed array, but this would need a major rewrite.

quoll avatar Dec 08 '14 15:12 quoll

hm... as long as the number of data types is known up front, it could be possible to encode the type in the last few bits of an index into a single array.

ritschwumm avatar Dec 10 '14 00:12 ritschwumm