|
From: Christian C. <chc...@cl...> - 2001-08-12 05:52:09
|
Eric Bezault a =E9crit :
>=20
> Christian Couder wrote:
> >
> > And put_new_line like features are awfull too because it means that
> > every time you add a "put_string" or an "append_string" like feature =
to
> > a class you should also add a special case "put_new_line" or
> > "append_new_line" feature to the class.
>=20
> What about:
>=20
> put_line ("Hello world!")
>=20
> instead of:
>=20
> put_string ("Hello world!")
> put_new_line
>=20
> ? It looks symmetrical to the `read_line' routine
> to me: the string doesn't include the line-separator
> but it is actually there in the file.
It solves the typing problem because it's shorter, but it doesn't solve
the problem that you will in many cases have to create 2 features in
many classes instead of only one (for example: append_string and
append_line, put_string and put_line). And some people will probably
mistake the 2 features.
> > It's also much shorter to type " + eol" than "io.put_new_line" on a n=
ew
> > line or something like this.
>=20
> But it creates an extra string object at run-time.
If eol is a once string then it's created only once in each program.
Regards,
Christian.
|