strings

From: Stefan Monnier <stefan.monnier_at_epfl.ch>
Date: Thu, 31 Aug 1995 17:03:03 +0200

Why are STk strings null-terminated ?
Since they have a length attribute, they don't need to be null-terminated,
right ?

I undersand that Tk expects null-terminated strings, but STk doesn't have to
be broken just because Tcl was broken. It's very easy to add a null character
at the end of strings when necessary ?

It's espceially annoying when dealing with binary I/O.

And it's just annoying because:

STk> (define tmp "01234\00098765")
#[undefined]
STk> (define tmp2 "01234")
#[undefined]
STk> tmp
"01234"
STk> tmp2
"01234"
STk> (string=? tmp tmp2)
#t
STk> (= (string-length tmp) (string-length tmp2))
#f
STk>


        Stefan
Received on Thu Aug 31 1995 - 17:04:43 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST