Skip to content

Commit

Permalink
adding free style hakcing in both
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Feb 23, 2015
1 parent ccf8bf1 commit 63534ec
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions NeoCSV/NeoCSV.pier
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,22 @@ Array streamContents: [ :out |
]]]


!! Without Mapping Definition

Both NeoCSV and NeoJSON can operate in two ways, (1) without the definition of any schema's or (2) with the definition of schema's and mappings. Therefore you can use them both using a quick and dirty explore style. Here are some examples:

[[[
'my-data.csv' asFileReference readStreamDo: [ :in | (NeoCSVReader on: in) upToEnd ].

-> an array of arrays
]]]

[[[
'my-data.json' asFileReference readStreamDo: [ :in | (NeoJSONReader on: in) next ].

=> objects structured using dictionaries and arrays
]]]

!! Conclusion

NeoCSV provides a good support to emit or import comma separated data.
Expand Down
17 changes: 17 additions & 0 deletions NeoJSON/NeoJSON.pier
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,23 @@ instead of:
{}
]]]

!! Without Mapping Definition

Both NeoCSV and NeoJSON can operate in two ways, (1) without the definition of any schema's or (2) with the definition of schema's and mappings. Therefore you can use them both using a quick and dirty explore style. Here are some examples:

[[[
'my-data.csv' asFileReference readStreamDo: [ :in | (NeoCSVReader on: in) upToEnd ].

-> an array of arrays
]]]

[[[
'my-data.json' asFileReference readStreamDo: [ :in | (NeoJSONReader on: in) next ].

=> objects structured using dictionaries and arrays
]]]


!! Conclusion

NeoJSON is a powerful library to convert objects. Now Sven developed STON (Smalltalk object notation) which is closer to Pharo syntax and handles cycles and references between serialized objects.

0 comments on commit 63534ec

Please sign in to comment.