Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!bellcore!texbell!texsun!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: any chance of real multi-dimensional arrays? Message-ID: <100127@convex.convex.com> Date: 21 Feb 90 01:06:49 GMT References: <1990Feb20.225434.2045@athena.mit.edu> Sender: news@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: usa Organization: CONVEX Software Development, Richardson, TX Lines: 40 In article <1990Feb20.225434.2045@athena.mit.edu> ccount@athena.mit.edu (Craig A Counterman) writes: |Emulated multidimensional arrays are not intuitive. I.e. I haven't |been able to figure out how to do what I want with them. Is there any |chance of making '$var[2][0] = 3; $var[2][1] = 4; print $var[2];' do |the right thing? Is that you want them to do? The problem I see with doing multi-dimensional arrays the way you've said them is growing both indices dynamically. I'll think on your example overnight and come up with a way to do that, although I imagine Larry or Randal or someone else will beat me to it. |Also, since there are lists I'd also like the whole suite of Lisp |functions like 'mapcar'. Actually, I think most exist under other |names, e.g. it looks like 'grep' is actually 'mapcar' by another name. If |this is true, could lisp-ish names also be used, or at least |documented as such? Don't we have enough reserved functions? I can see documenting how grep can be used like mapcap, but don't think alternate names are the way to go. |And I'd like more stream input functions, like scanf or a 'get_word' |function. I've written the latter easily enough as a subroutine, but |still... ICK! Why would you want a scanf() when you have perl unbelievably more powerful regular expression parsing mechanism? If you're dead-set to do this, you could probably write your own scanf. I don't think it's a good idea though. For the array thing, you may have a point, but for both the mapcar and the scanf things, it seems that you're trying to turn perl into languages that they're not. It reminds me of lisp-like alias for csh lists. --tom -- Tom Christiansen {uunet,uiucdcs,sun}!convex!tchrist Convex Computer Corporation tchrist@convex.COM "EMACS belongs in : Editor too big!"