Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004874 [Squeak] Collections feature N/A 09-11-06 15:23 10-03-09 19:33
Reporter oscar View Status public  
Assigned To andreas
Priority normal Resolution fixed  
Status assigned   Product Version 3.9
Summary 0004874: Need split and join for text manipulation tasks
Description Perl, Python and Ruby all support split and join for strings. Split will split a string on each match of a regex into a list of substrings, and join will join a list of strings into a single string given a separator.
As far as I can tell there is no easy way to simulate either split or join with existing Squeak methods.
I propose to add String>>split: aRegexString (which should call RxMatcher>>split: aString). I also propose adding SequenceableCollection>>join: anOrderedCollection (which is the obvious generalization of String>>join: aString). I also propose to include the VB-Regex categories in the standard image (which is why I propose this here rather than in Squeak Packages). To see a version with tests, look at:
http://squeaksource.com/RubyShards/ [^]
Additional Information
Attached Files  Join-kph.1.mcz [^] (1,245 bytes) 10-10-06 19:15
 Join-kph.2.mcz [^] (2,822 bytes) 10-19-06 14:55
 Join.1.cs [^] (13,289 bytes) 10-19-06 15:25
 Join.2.cs [^] (7,920 bytes) 10-19-06 18:31
 Join.3.cs [^] (8,168 bytes) 10-19-06 18:43
 Join.4.cs [^] (5,493 bytes) 12-18-06 06:23
 JoinTest.1.cs [^] (2,776 bytes) 12-18-06 06:24
 SplitJoin-onierstrasz.25.mcz [^] (11,077 bytes) 04-12-09 18:50
 SplitJoin-onierstrasz.26.mcz [^] (11,024 bytes) 04-12-09 19:00

- Relationships

- Notes
(0007731 - 593 - 695 - 695 - 695 - 695 - 695)
Keith_Hodges
10-19-06 15:01
edited on: 10-19-06 18:44

Join-kph-2.mcz Has a separate package 'Join'.
Join.3.cs is merged into SequenceableCollection and CollectionsTests
it has some method comments

Implements #joinUsing: and #splitOn: both using a double dispatch

$/ useToJoin: aSequencableCollection
aSequenceableCollection joinUsing: $/
aSequenceableCollection joinUsing: ', ' last: ' and'

aSequencableCollection splitOn: splitter
where splitter can be any sequenceable collection, or a Block

aSequencableCollection splitUp: aSequenceableCollection
aBlock splitUp: aSequenceableCollection
aSequencableCollection split: aBlock

 
(0008721 - 166 - 232 - 232 - 232 - 232 - 232)
Keith_Hodges
12-18-06 06:20
edited on: 12-18-06 10:52

"fix begin"
Installer mantis bug: 4874 fix: 'Join.4.cs' date: '12-18-06'.
"fix test"
Installer mantis bug: 4874 fix: 'JoinTest.1.cs' date: '12-18-06'.
"fix end"

 
(0013082 - 305 - 305 - 439 - 439 - 439 - 439)
oscar
04-12-09 18:52

http://www.squeaksource.com/SplitJoin.html [^] is an attempt to merge and generalize two version sof the split join functionality. The end result is largely consistent with Keith's implementation. Additionally, objects and regexes can be splitters, and OrderedCollections and SortedCollections may be joiners.
 

- Issue History
Date Modified Username Field Change
09-11-06 15:23 oscar New Issue
10-10-06 19:15 Keith_Hodges File Added: Join-kph.1.mcz
10-10-06 19:15 Keith_Hodges Issue Monitored: Keith_Hodges
10-19-06 14:55 Keith_Hodges File Added: Join-kph.2.mcz
10-19-06 15:01 Keith_Hodges Note Added: 0007731
10-19-06 15:23 Keith_Hodges Note Edited: 0007731
10-19-06 15:25 Keith_Hodges File Added: Join.1.cs
10-19-06 18:31 Keith_Hodges File Added: Join.2.cs
10-19-06 18:34 Keith_Hodges Note Edited: 0007731
10-19-06 18:43 Keith_Hodges File Added: Join.3.cs
10-19-06 18:44 Keith_Hodges Note Edited: 0007731
12-18-06 06:20 Keith_Hodges Note Added: 0008721
12-18-06 06:23 Keith_Hodges File Added: Join.4.cs
12-18-06 06:24 Keith_Hodges File Added: JoinTest.1.cs
12-18-06 06:28 Keith_Hodges Note Edited: 0008721
12-18-06 06:35 Keith_Hodges Note Edited: 0008721
12-18-06 10:51 Keith_Hodges Note Edited: 0008721
12-18-06 10:52 Keith_Hodges Note Edited: 0008721
01-10-09 01:47 Keith_Hodges Status new => pending
01-10-09 02:27 Keith_Hodges Status pending => testing
01-10-09 03:39 Keith_Hodges Status testing => resolved
01-10-09 03:39 Keith_Hodges Fixed in Version  => 3.11
01-10-09 03:39 Keith_Hodges Resolution open => fixed
01-10-09 03:39 Keith_Hodges Assigned To  => Keith_Hodges
01-10-09 03:41 Keith_Hodges Status resolved => testing
04-12-09 18:50 oscar File Added: SplitJoin-onierstrasz.25.mcz
04-12-09 18:52 oscar Note Added: 0013082
04-12-09 19:00 oscar File Added: SplitJoin-onierstrasz.26.mcz
10-03-09 19:33 Keith_Hodges Status testing => assigned
10-03-09 19:33 Keith_Hodges Assigned To Keith_Hodges => andreas


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
91 total queries executed.
36 unique queries executed.
Powered by Mantis Bugtracker