Talk:SEDOLs: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎R: Does the R solution reject strings with vowels in them?)
(→‎R: Modula-3 too)
Line 16: Line 16:
Does the R solution reject strings with vowels in them? It says on [[wp:SEDOL#Description|the wikipedia]] that vowels are never used in the 6-character code, so the function should reject strings that have them. (Is this a common trait of languages with single letter names ;-)<br>
Does the R solution reject strings with vowels in them? It says on [[wp:SEDOL#Description|the wikipedia]] that vowels are never used in the 6-character code, so the function should reject strings that have them. (Is this a common trait of languages with single letter names ;-)<br>
--[[User:Paddy3118|Paddy3118]] 19:18, 29 September 2009 (UTC)
--[[User:Paddy3118|Paddy3118]] 19:18, 29 September 2009 (UTC)
:Now it looks like Modula-3 doesn't do the check. Maybe we need to move the algorithm here. --[[User:Mwn3d|Mwn3d]] 22:10, 29 September 2009 (UTC)


== '0' checksum ==
== '0' checksum ==

Revision as of 22:10, 29 September 2009

J

Does the J solution reject strings with vowels in them? It says on the wikipedia that vowels are never used in the 6-character code, so the function should reject strings that have them. --Mwn3d 04:58, 5 August 2008 (UTC)

The J code isn't a validator, it merely calculates and appends the check digit.
You could modify it to whine about vowels by removing them:
    sn   =.  '0123456789 BCD FGH JKLMN PQRST VWXYZ'  
Not terribly exciting.
68.175.31.239 12:44, 5 August 2008 (UTC) (aka DanBron)

R

Does the R solution reject strings with vowels in them? It says on the wikipedia that vowels are never used in the 6-character code, so the function should reject strings that have them. (Is this a common trait of languages with single letter names ;-)
--Paddy3118 19:18, 29 September 2009 (UTC)

Now it looks like Modula-3 doesn't do the check. Maybe we need to move the algorithm here. --Mwn3d 22:10, 29 September 2009 (UTC)

'0' checksum

Among the test strings ought to be one that requires a '0' to verify that the checksum is in the range 0..9 instead of 1..10. --IanOsgood 00:34, 7 August 2008 (UTC)

TCL and _

Hi, I generally like the use of '_' in the TCL solution, but on checking, I find that it fails to reject the use of '_' in a SEDOL: <lang tcl>(bin) 11 % set code B0YBKT B0YBKT (bin) 12 % set sedol "${code}[sedol::checksum $code]" B0YBKT7 (bin) 13 % set code B0YBAT B0YBAT (bin) 14 % set sedol "${code}[sedol::checksum $code]" invalid character: A (bin) 15 % set code B0YB_T B0YB_T (bin) 16 % set sedol "${code}[sedol::checksum $code]" B0YB_T7 (bin) 17 % </lang> --Paddy3118 05:01, 28 April 2009 (UTC)

True. I'll fix that. --Glennj 11:19, 28 April 2009 (UTC)