Commit b3b02fc1 authored by Thomas van Noort's avatar Thomas van Noort

Added some new lines for clarification

git-svn-id: https://svn.cs.ru.nl/repos/clean-platform/trunk@9 2afc29ad-3112-4e41-907a-9359c7e6e986
parent 2495138b
......@@ -29,15 +29,17 @@ there are two rules which make your functions easier to use and somewhat more cl
== Comments ==
A concise description of the purpose of a function and the meaning of its input and output
parameters should be present in the .dcl file for all exported functions. Comments are enclosed
parameters should be present in the .dcl file for all exported functions. Comments are specified
as follows:
/**
* This function is the identity
* This function is the identity.
*/
id :: a -> a
id x = x
The @param notation (similar to JavaDocs) can be used to clarify the arguments separately.
== Layout ==
Whitespace and new lines can be used to format code nicely. When tabs are used for alignment, they are
considered to be fixed to four spaces.
......@@ -10,11 +10,13 @@ definition module Text
*/
class Text s
where
/**
* Calculates the number of logical characters in a piece of text.
* When a multibyte encoding is used, this is less then the size in bytes.
*/
textSize :: !s -> Int
/**
* Splits a string into a list of strings using a separator string.
*
......@@ -22,6 +24,7 @@ class Text s
* @param The string that is to be splitted.
*/
split :: !s !s -> [s]
/**
* Joins a list of strings using a separator string.
*
......@@ -29,6 +32,7 @@ class Text s
* @param The string that is to be splitted.
*/
join :: !s ![s] -> s
/**
* Find the first occurence of a substring in another string.
*
......@@ -36,13 +40,15 @@ class Text s
* @param The string that is being searched.
*/
indexOf :: !s !s -> Int
/**
* Find the last occurence of a substring in another string.
* Find the last occurence of a substring in another string.
*
* @param The search string.
* @param The string that is being searched.
*/
lastIndexOf :: !s !s -> Int
/**
* Predicate which tests if a string starts with another substring
*
......@@ -50,6 +56,7 @@ class Text s
* @param The string that is being searched.
*/
startsWith :: !s !s -> Bool
/**
* Predicate which tests if a string ends with another substring
*
......@@ -57,14 +64,16 @@ class Text s
* @param The string that is being searched.
*/
endsWith :: !s !s -> Bool
/**
* Take a substring from a string
*
* @param the logical start index.
* @param the logical length of the substring.
* @param the string from which the substring is taken.
* @param The logical start index.
* @param The logical length of the substring.
* @param The string from which the substring is taken.
*/
subString :: !Int !Int !s -> s
/**
* Replaces all occurences of a substring with another in a string
*
......@@ -73,22 +82,27 @@ class Text s
* @param The string that is being searched.
*/
replaceSubString :: !s !s !s -> s
/**
* Removes whitespace from the beginning and end of a string.
*/
trim :: !s -> s
/**
* Removes whitespace from the beginning of a string.
*/
ltrim :: !s -> s
/**
* Removes whitespace from the end of a string.
*/
rtrim :: !s -> s
/**
* Converts all characters in a string to lower case.
*/
toLowerCase :: !s -> s
/**
* Converts all characters in a string to upper case.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment