From: Gavin Sinclair Date: 2012-04-28T13:44:17+09:00 Subject: Re: Call for comments - Structure --00235452ecf4940dee04beb5df97 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Apr 5, 2012 at 9:29 AM, Hal Fulton wrote: > Greetings, fellow Rubyists... > > I am revisiting a small project that has lain dormant for > some time... > > http://github.com/Hal9000/Structure > > As I make changes and improvements, I'd be interested in > hearing your comments. > > You're welcome to critique the idea itself, the implementation, > missing features, the code, the style, or whatever. > I like what I read in the README, and would definitely use it in future if it's a well-maintained project. My comment: prefer symbols over strings. For instance, the "members" method should return an array of symbols, not strings. Accept strings by all means, but only produce symbols. I second Intransition's comments on default values and ways of initialising. I don't think the following needs to happen: # The act of retrieving a nonexistent field from an open struct will # create that field myStruct = Structure.open x = myStruct.new x.foo # nil If it were me, fields would only be created on assignment, not on reference. I would still return nil when x.foo was called. Nice work! I hope you revive the project. Gavin --00235452ecf4940dee04beb5df97 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Thu, Apr 5, 2012 a= t 9:29 AM, Hal Fulton <rubyhacker@gmail.com> wrote:
Greetings, fellow Rubyists...

I am revisiting a small project that h= as lain dormant for
some time...

http://github.com/Hal9000/Structure=

As I make changes and improvements, I'd be interested in
hearing your comments.

You're welcome to critique the idea itsel= f, the implementation,
missing features, the code, the style, or whatev= er.

I like what I read in the README, a= nd would definitely use it in future if it's a well-maintained project.=

My comment: prefer symbols over strings. =A0For instanc= e, the "members" method should return an array of symbols, not st= rings. =A0Accept strings by all means, but only produce symbols.

I second Intransition's comments on default values and w= ays of initialising.

I don't think the followi= ng needs to happen:
  # The act of retrieving a nonexi=
stent field from an open struct will
  # create that field
  myStruct =3D Structure.open
  x =3D myStruct.new
  x.foo   # nil
If it were me, fields would only be created= on assignment, not on reference. =A0I would still return nil when x.foo wa= s called.

Nice work! =A0I hope you revive the proj= ect.

Gavin
--00235452ecf4940dee04beb5df97--