Re: ANN: doodle 0.0.1



Hi James!

On Mon, Mar 10, 2008 at 11:08 AM, James Adam <james.adam@xxxxxxxxx> wrote:

Are there any cases where you'd want to use "collect", but not ":init => []" ?

:collect works for anything that provides a :<< method, though I've
only tested it with Array, String, StringIO and Set.
But initializing with an Array if you use :collect on its own without
specifying an initial value might be useful (though I'm not keen to
have too much 'magic' in there).


I think it'd also be really interesting to hear if you were using this
library for anything specific - importing data, for example?

Funny you should mention that :) One use is for validating
quasi-freeform text records of the form:

field1: value
field2: value

field1: value
field2: value

where both field and value have to be validated as well as the whole
record once assembled.

Another is for config files (sometimes yaml just gets too confusing
and you still have to validate anyway).
A colleague at work is using it for a DSL (which is where the Event
example comes from and what prompted me to release it as a gem).


Looks very interesting though!

Well, it's been keeping me occupied through the cold winter nights :)

Best regards,
Sean

.



Relevant Pages

  • creating a TOC from a report
    ... In the OnPrint property of the report, ... Dim field1 as string, field2 as string ...
    (microsoft.public.access.reports)
  • Re: update query
    ... will match any string which starts with a and ends with c. ... Probably because you have an extra blank between table1. ... Is there in fact a field named Field2 in your query? ... SET Field1 = Field2 ...
    (microsoft.public.access.queries)
  • Re: [XSL] how could I know node attributes???
    ... all the field1 values, all the field2 values, all the field3 values, ... selects all attribute nodes where the local name starts with the string ...
    (comp.text.xml)
  • RE: Slit String
    ... Right functions to extract the left and right parts of the string into Field1 ... you would use the Val function which converts a ... and Field2 as a numeric variable. ...
    (microsoft.public.access.modulesdaovba)
  • Help in French|Spanish|German translation.
    ... I am also an author of User-defined string functions. ... WORDTRANEX (cSearched, cArExpressionSought | cExpressionSough, ... each string of the array is searched ... If the parameter nArStartOccurrence is -1 or omitted, the replacement starts ...
    (microsoft.public.fox.helpwanted)