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

how to make a vector of constants?



I'm building this system:

define constant $jack = 11;
define constant $queen = 12;
define constant $king = 13;
define constant $ace = 14;

and I want to do this:

let faces = #[ $jack, $queen, $king, $ace ];

when I try to compile I get [FD]:

Unexpected token: "$jack".

Is there a simpler/cleaner way than:

let faces = make(<vector>,size: 4);
faces[0] := $jack;
faces[1] := $queen;
faces[2] := $king;
faces[3] := $ace;

(I'm not looking for let faces = #[11, 12, 13, 14]; because I plan to
reify these constants later)

Sincerely,
Douglas M. Auclair


Sent via Deja.com http://www.deja.com/
Before you buy.



Follow-Ups: