[pure-lang-svn] SF.net SVN: pure-lang: [409] pure/trunk
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-07-07 11:19:03
|
Revision: 409 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=409&view=rev Author: agraef Date: 2008-07-07 04:19:13 -0700 (Mon, 07 Jul 2008) Log Message: ----------- Make slicing work with strings. Modified Paths: -------------- pure/trunk/ChangeLog pure/trunk/lib/strings.pure Modified: pure/trunk/ChangeLog =================================================================== --- pure/trunk/ChangeLog 2008-07-07 00:32:43 UTC (rev 408) +++ pure/trunk/ChangeLog 2008-07-07 11:19:13 UTC (rev 409) @@ -1,5 +1,7 @@ 2008-07-07 Albert Graef <Dr....@t-...> + * lib/strings.pure: Make slicing work with strings. + * lib/prelude.pure: Fixed a bug in init function. Reported by Libor Spacek. Modified: pure/trunk/lib/strings.pure =================================================================== --- pure/trunk/lib/strings.pure 2008-07-07 00:32:43 UTC (rev 408) +++ pure/trunk/lib/strings.pure 2008-07-07 11:19:13 UTC (rev 409) @@ -143,6 +143,11 @@ end; end when m = #delim end if not null delim; +/* Slicing. */ + +s::string!!ns = strcat [s!n; n=ns; n>=0 && n<m] + when m::int = #s end; + /* Define the customary list operations on strings, so that these can mostly be used as if they were lists. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |