[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Version number in star packages

From: Paolo Bonzini
Subject: Re: [Help-smalltalk] Version number in star packages
Date: Thu, 31 Dec 2009 00:55:00 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 12/30/2009 11:15 PM, Gwenael Casaccio wrote:
+    parseVersion: aString [
+       <category: 'version parsing'>
+       | tokens |
+       (tokens := aString tokenize: '\.') size = 3 ifFalse: [ self error: 'Bad 
version string : ', aString, ' should be xx.yy.zz' ].
+       self version: (Version major: tokens first asInteger minor: tokens 
second asInteger patch: tokens third asInteger)
+    ]

This should:

1) use #subStrings: or alternatively a single regex match


instead of tokenize.

2) be in Version class>>#fromString:

3) accept a version like 1.0 and change it to 1.0.0 (see regex above).

Otherwise looks fine, filtering of prerequisites based on their version can be done later.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]