method string.make_objects
Make objects from a string of delimited data
Contract
Return typewob
Parameter keyDefault valueType
makervectorvar
subject_for_maker"_use_maker"string
field_separator<char ","/>path
object_separator<char 10/>path
trim_fieldsfalseboolean
trim_subjecttrueboolean
Water Contract
<method string.make_objects
  maker         =vector
  subject_for_maker="_use_maker"
  field_separator=char.comma 
  object_separator=char.newline 
  trim_fields   =false
  trim_subject  =true/>

See also: make_object, subvectors, vector, pattern

Splits the _subject string into substrings each of which are then passed off to make_object to make into an object. A vector of the objects is returned. Using all the defaults, make_objects splits a comma separated value (csv) string into a vector of vectors. Each inner vector represents a line of the input string that has field values of the strings between the commas. See the documentation for make_object for additional information and examples of making objects from string type data.
Example: Using defaults for make objects
"10,20
30,40
45,90".<make_objects />
<v <v "10" "20" /> <v "30" "40" /> <v "45" "90" />/>

a wob
Parameter keyDefault valueType
object_separator<char 10/>path
The character delimiter or pattern used to separate the objects in the _subject string.

Example: Using an object separator
"Fry,Christopher|Plusch,Mike".<make_objects object_separator=<char "|" /> />
<v <v "Fry" "Christopher" /> <v "Plusch" "Mike" />/>

a wob
Parameter keyDefault valueType
field_separator<char ","/>path
The character delimiter or pattern used to separate the fields in the objects of the _subject string.

Example: Using a field separator
"Fry/Christopher|Plusch/Mike".
<make_objects object_separator=<char "|" /> field_separator=<char "/" /> />
<v <v "Fry" "Christopher" /> <v "Plusch" "Mike" />/>

a wob
Parameter keyDefault valueType
makervectorvar
Specifies the object or method that will be used as the maker for the objects that are extracted from the _subject string.

Example: Using a class as maker
<class foo x=req  y=req  />
"10,20
30,40
45,90".<make_objects maker=foo />
<v <foo x="10" y="20" /> <foo x="30" y="40" /> <foo x="45" y="90" />/>

a wob
Parameter keyDefault valueType
subject_for_maker"_use_maker"string
Specifies the _subject that will be used for calls to the maker. There are two special values for this field.

a wob
subject_for_maker="_use_maker"
By default, make_objects uses the given maker as the _subject of the calls to make_object.
Example: Using a class as maker
<class foo x=req  y=req  />
"10,20
30,40
45,90".<make_objects maker=foo subject_for_maker="_use_maker" />
<v <foo x="10" y="20" /> <foo x="30" y="40" /> <foo x="45" y="90" />/>
a wob
subject_for_maker="_first_value"
The first field of each object can be used as the _subject of each call to maker. This is expecially useful if the maker is a method.
Example: Make objects using a method
"one,two,three
four,five,six".
<make_objects  maker=join subject_for_maker="_first_value" />
<v "onetwothree" "fourfivesix"/>
The example above uses the first value of each line as the _subject of a call to the join method, e.g., for the first object, the call to join looks like "one".<join "two" "three" />.

a wob
Parameter keyDefault valueType
trim_subjecttrueboolean
If trim_subject is true (the default), the input string will have white space removed from its beginning and end before any other processing is done.

a wob
Parameter keyDefault valueType
trim_fieldsfalseboolean
If trim_fields is true, then once _subject has been split into one string for each object, and each of those strings is split into individual field values, those fields will have white space removed from their beginnings and ends before using them for field values.