System Function CS

From NARS2000
Jump to: navigation, search

⎕CS - Collating Sequence

⎕CS is niladic system function which returns a well-known collating sequence appropriate to grading character arrays via the Dyadic Grade function.

Z←⎕CS returns a well-known Collating Sequence for grading character arrays, extended to account for accented Latin alphabets.
Z is a four-dimensional character array of shape 10 6 2 28 with 3360 ≡ ×/10 6 2 28 characters.

The values as arranged as follows:

  • The length 28 coordinate contains one space followed by a 26-letter Latin alphabet and another space.
  • The length 2 coordinate distinguishes between the lowercase from the uppercase of the Latin alphabet.
  • The length 6 coordinate distinguishes between the one unaccented and five accented Latin alphabets.
  • The length 10 coordinate distinguishes between the ten digits.
  • All other values not specified above are blank.

While this collating sequence is very useful, it is not the end of the question. It needs to be modified for special circumstances, for example if you are grading numbers with a decimal point. Think of it as a starting point for more special purpose needs.

To give you a flavor of this sequence, here's the first hyperplane of ⎕CS, where a Blank Symbol () is used in place of a space to serve as a visible reminder of its presence:

      ⎕CS[1;;;]
␢abcdefghijklmnopqrstuvwxyz0
␢ABCDEFGHIJKLMNOPQRSTUVWXYZ␢

␢ábćdéfǵhíjḱĺḿńóṕqŕśtúvẃxýź␢
␢ÁBĆDÉFǴHÍJḰĹḾŃÓṔQŔŚTÚVẂXÝŹ␢

␢àbcdèfghìjklmǹòpqrstùvẁxỳz␢
␢ÀBCDÈFGHÌJKLMǸÒPQRSTÙVẀXỲZ␢

␢âbĉdêfĝĥîĵklmnôpqrstuvwxyz␢
␢ÂBĈDÊFĜĤÎĴKLMNÔPQRŜTÛVŴXŶẐ␢

␢äbcdëfgḧïjklmnöpqrsẗüvẅẍÿz␢
␢ÄBCDËFGḦÏJKLMNÖPQRSTÜVẄẌŸZ␢

␢ãbcdẽfghĩjklmñõpqrstũṽwxỹz␢
␢ÃBCDẼFGHĨJKLMÑÕPQRSTŨṼWXỸZ␢

The following APL pseudo-function describes how ⎕CS could be created:

    ∇ Z←⎕CS;⎕IO
[1]   ⎕IO←1
[2]   Z←10 6 2 28⍴' '
[3]   Z[1;1;;1+⍳26]←⎕a,[0.5] ⎕A
[4]   Z[1;2;;1+⍳26]←⎕á,[0.5] ⎕Á
[5]   Z[1;3;;1+⍳26]←⎕à,[0.5] ⎕À
[6]   Z[1;4;;1+⍳26]←⎕â,[0.5] ⎕Â
[7]   Z[1;5;;1+⍳26]←⎕ä,[0.5] ⎕Ä
[8]   Z[1;6;;1+⍳26]←⎕ã,[0.5] ⎕Ã
[9]   Z[;1;1;28]←⎕D
    ∇

See also: Unicode page and ⎕A and friends.


Note: CS is a niladic form system function, you cannot assign a value to it.

System Variables (A value may be assigned to these except for ⎕DM)
ALX CT DM DT ELX FC FEATURE FPC IC IO
LX PP PR PW RL SA WSID
Niladic System Functions (a value cannot be assigned to these)
A AV EM ET LC NNAMES NNUMS SYSID SYSVER T
TC TCBEL TCBS TCESC TCFF TCHT TCLF TCNL TCNUL TS
WA
Monadic or dyadic system functions (a value cannot be assigned to these)
AT CR DC DL DR EA EC ERROR ES EX
FMT FX MF NAPPEND NC NCREATE NERASE NINFO NL NLOCK
NREAD NRENAME NREPLACE NRESIZE NSIZE NTIE NUNTIE STOP TF TRACE
UCS VR
Note that quad functions and variables are case insensitive


See Also
System Commands System Variables and Functions Operators
Keyboard
A+S
Alt ¨ ¯ < > × ÷
Sh ~ ! @ # $ % ^ & * ( ) _ +
Key ` 1 2 3 4 5 6 7 8 9 0 - =
A+S
Alt ? π
Sh Q W E R T Y U I O P { } |
Key q w e r t y u i o p [ ] \
A+S §
Alt
Sh A S D F G H J K L : "
Key a s d f g h j k l ; '
A+S
Alt
Sh Z X C V B N M < > ?
Key z x c v b n m , . /
NARS 2000 Lang
Tool
Bar
+ - × ÷ * ! ? |
= < >
~ § π .. ,
/ \ ¨ .
_ ¯ b e g p r v x