Menu

#18 Format pre-defined operation has no effect

open
None
8
2008-01-23
2008-01-23
No

The following code is parsed by does not seems to
be implemented by the compiler:

var mystr := "My name is '%s'" % self.name;
var mystr := "%s(%s)" % Sequence{opnamr,argtxt};

The '%' operator corresponds to a call to the pre-defined
String::format(Object) operation.

As a first implementation of the pre-defined "format" operation I would expect that it works at least for
the following simple cases:

- A unique string is passed as argument.
- An ordered collection of strings is passed (could
be a Sequence, an OrderedSet or a List).
- If integers and booleans are passed they are treated
as strings (using repr method).

Discussion


Log in to post a comment.

Auth0 Logo