Skip to content

Commit

Permalink
Use version as string
Browse files Browse the repository at this point in the history
Version 0.20 is read as 0.2, which is less than 0.19, according to the
version comparators.  This can cause problems when chicken-install
takes decisions based on version numbers.

Although (> 0.20 0.19) => #t,  (version>=? 0.20 0.19) => #f.  However,
(version>=? "0.20" "0.19") => #t.

That's because versions are (read) by setup-api and tokenized using
`.' as separators.  If versions are numbers, they are read as numbers
then converted to strings, then parsed by the version API.  So, 0.20
is read as 0.2, converted to "0.2" and tokenized as ("0" "2").  Then,
converted back to numbers we have (0 2).  If we apply the same to
0.19, we have (> 2 19) => #f.

By using versions as strings, we have "0.20" read as a string,
tokenized as ("0" "20") and converted back to numbers as (0 20).
Thus, (> 20 19) => #t.
  • Loading branch information
mario-goulart committed May 9, 2014
1 parent a5967f1 commit 862c1d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pastiche.setup
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

(install-extension 'pastiche
'("pastiche.so" "pastiche.import.so")
'((version 0.20)))
'((version "0.20")))

0 comments on commit 862c1d7

Please sign in to comment.