[Oberon] Oberon with strings, Eberon

Jörg Straube joerg.straube at iaeth.ch
Mon Feb 22 08:39:47 CET 2016


Lars

He does NOT get the string spinach!
Strings are more complex than it seems.
What do you think the function call "length(str)" should return?

The main problem in implementing strings is the question: how to represent a character internally? Or in other words is a character one byte, two bytes or four bytes.
Coming back to the question: What shoud length(str) return?
Is it the number of characters or the number of bytes?

The fork Eberon returns as length the number of 16 bit units. Unfortuntaly, there are characters (eg emojis) that need two of those 16 bit units to be represented correctly.
Although the "str" has only ONE emoji character, in Eberon "length(str)" will return TWO.

Jörg

> Am 21.02.2016 um 22:00 schrieb Lars <noreply at z505.com>:
> 
> Found an oberon programmer who "gets it".. i.e. spinach
> 
> https://github.com/vladfolts/oberonjs/wiki/Eberon-Strings
> 
> Have to research this. I'm posting it to the list to make it more known
> that there are people who know of the string problem and aren't denying
> it.
> 
> With all these forks of oberon, it's the same problem as standard pascal.
> You have about 200 different versions of pascal floating around, because
> standard pascal was castrated and circumscribed in its standard form. So
> people extend it which fragments the community into hundreds of forks.
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2376 bytes
Desc: not available
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20160222/9dc22e16/attachment.p7s>


More information about the Oberon mailing list