Skip to content
Tcl Source Code View Ticket
Login

View Ticket

support for multivariable set

Closed / Fixed218126ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:53:27
OriginalBugID: 1984 RFE
Version: 8.0.5
SubmitDate: '1999-05-04'
LastModified: '1999-08-06'
Severity: MED
Status: Closed
Submitter: pat
ChangedBy: hobbs
OS: SunOS
OSVersion: 2.6
Machine: Sparc
FixedDate: '2000-10-25'
ClosedDate: '1999-08-06'


Name:
Paulo Dutra

DesiredBehavior:
In Perl, I can short cut this to
    
    ($device, $package, $speed) = split(/-/, $part_type);
    
    I would like this extended to Tcl as 
    
    set {device package speed} [split $part_type -]



That would be:
    foreach {device package speed} [split $part_type -] {break}

The break ensures that if the split produces more than 3 items,
we only get the first three. 
-- 08/06/1999 hobbs
welch Closed ticket [218126ffff]. [History diff]2000-10-26 08:15:54
dgp Open ticket [218126ffff]. [History diff]2001-04-21 01:28:58
dgp Closed ticket [218126ffff]. [History diff]2001-04-21 02:05:46
Log in (anonymous is fine) to add a comment.