[Prev][Next][Index][Thread]
how to make a vector of constants?
-
To: info-dylan@ai.mit.edu
-
Subject: how to make a vector of constants?
-
From: dauclair@hotmail.com
-
Date: Tue, 7 Mar 2000 12:00:02 -0500 (EST)
-
Organization: Deja.com - Before you buy.
-
Xref: traf.lcs.mit.edu comp.lang.dylan:11599
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: