News for hackers. Stuff that matters.
Re:A basic forking server in Oberon-2 by e12e on Wednesday May 04, 2016 @01:20PM (#11629889)
The hard-coding of the length of the "aff" string and/or re-use of the "s" (size) variable does indeed look odd:

   s := SIZE(String);
   aff := "Affirmative, Dave";
   (...)
   s := 17;
   n := Unix.Write(sock, S.ADR(aff), s);
As far as I can gather from: https://github.com/norayr/voc/blob/master/src/lib/v4/Strings... this implementation uses some kind of c strings (not familiar with Oberon in general, but I thought that the norm was something like Pascal strings?): "Strings provides a set of operations on strings (i.e., on string constants and character arrays, both of which contain the character 0X as a terminator). All positions in strings start at 0. Strings.Length(s) returns the number of characters in s up to and excluding the first 0X."

It would seem that:

  s := String.Length(arr);
should be the sane equivalent to "s := 17;"

There are no comments on this comment yet.