From: William Djaja Tjokroaminata Date: 2002-10-03T05:03:26+09:00 Subject: Re: thoughts on typelessness Exactly, Booker. I grew up in Fortran and C/C++, and I think most of the engineers are familiar with Fortran and C. I think these days they teach either Fortran, C, or Java in the engineering curriculum and not a single functional language at all. Although I am learning Ruby, I cannot expect the users of my code (whom mostly will be engineers) to change their state of mind. I hope now you understand why I think the way I do. I may change, but I cannot expect the users of my code to change much. As you see, Fortran, C, and Java are all procedural languages with static typing, and only in C we have to deal with memory de-allocation. That's why I am really interested to use a language similar to Ruby with some typing; if it is not for my sake, it is for my users' sake... Regards, Bill P.S. By the way, I do have a Link class. The "link" method is the abstract factory pattern function to create a Link object. For example, to quickly create a network with 2 nodes you can simply write: lk = link (node, node) Then if you want the link to be a T1 link, you can write lk.rate = 1.544e6 # link with 1.544 mbits/second data rate =========================================================================== bbense+comp.lang.ruby.Oct.02.02@telemark.stanford.edu wrote: >>def link (node0, node1, rate = 1e6, delay = 0.0, model = nil, attrs = nil, >>type = Link::TYPE_FULL_DUPLEX, label = '', name = '', simStart = false, >>simEnd = false, sim = nil) >> raise "..." unless rate.kind_of? Float >> raise "..." unless delay.kind_of? Float >> .... >>end >> > - - Ah ha, at last some code. First of all there is a huge code > smell here. You are writing Fortran in Ruby. NO method/function > in any language that supports data structures should have more > than 3 parameters. ( well maybe 4 in extreme cases.) Certainly, > in a Ruby method, more than 3 args is suspcicious. > - - Maybe you'd get a lot more out of Ruby if you spent some time > refactoring your code. I'd start out by making link an object > rather than a method. It's no wonder you want types in Ruby, > types would be a great addition to Fortran. > - - Booker C. Bense