[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [m2t-dev] [MTL] Standard library issues
|
ah, forgot one of the String ones :p.
4) strtok( String s1, Integer flag ) : String
Breaks the string self into a sequence of tokens each of which is
delimited by any character in string s1. The parameter flag should be 0
when strtok is called for the first time, 1 subsequently.
We fail to understand the meaning of the second parameter of this
method. What did you intend the flag to be used for in the
implementation? It seems pointless and troublesome to force the user to
pass 0 or 1 explicitely to this method when he wants to make use of it.
Laurent Goubet
Obeo
Laurent Goubet a écrit :
Hi Arjan,
I was looking at the specifications as to how the OCL standard library
has been extended for the needs of MTL and stumbled upon a set of
issues on which I would need your input. As I only began the
implementation, I'll only list the issues I have with the "String"
operations :
1) substitute( String r, String t ) : String
Substitutes substring r in self by substring t and returns the
resulting string. If there is no occurrence of the substring, it
returns the original string.
I think it would be nice to tweak the specification so that the first
parameter would be a regular expresion instead of a plain String. I'd
love to be able to use an equivalent of the Java's "replaceAll" method
for MTL Strings.
2) toUpper() : String
Creates a copy of self with all characters converted to uppercase and
returns it.
This has been listed as a method that should be added to "extend the
OCL standard library", but this method is *already* specified in the
OCL specifications for the aforementioned library and should be
removed from the MTL specification.
3)toLower() : String
Creates a copy of self with all characters converted to lowercase and
returns it.
As above, this is already present in the OCL standard library and
should probably be removed from the MTL specification.
I will list more of these issues here as I encounter them while
implementing the specification.
Regards
Laurent Goubet
Obeo
_______________________________________________
m2t-dev mailing list
m2t-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2t-dev
begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr/">Obeo</a>
email;internet:laurent.goubet@xxxxxxx
url:http://www.obeo.fr
version:2.1
end:vcard