https://github.com/sebastianconcept/json
JSON port from older PharoExtras @ Smalltalkhub
https://github.com/sebastianconcept/json
json pharo pharo-smalltalk smalltalk
Last synced: 4 months ago
JSON representation
JSON port from older PharoExtras @ Smalltalkhub
- Host: GitHub
- URL: https://github.com/sebastianconcept/json
- Owner: sebastianconcept
- License: mit
- Created: 2020-02-14T19:11:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-26T00:18:38.000Z (over 1 year ago)
- Last Synced: 2025-01-15T19:58:04.617Z (6 months ago)
- Topics: json, pharo, pharo-smalltalk, smalltalk
- Language: Smalltalk
- Homepage:
- Size: 43.9 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JSON
JSON abstraction for Pharo Smalltalk

[](https://github.com/sebastianconcept/JSON/releases)
[](./LICENSE.txt)[](https://pharo.org/download)
[](https://pharo.org/download)This is a port from older `smalltalkhub.com/PharoExtras/JSON`
This is a comfortable way to use Smalltalk objects that your program can eventually represent as JSON.
## Example
```smalltalk
"This is how you would use a typical dictionary:"
theUniverseAndEverything := Dictionary new
at: #theQuestion put: 'Questioner asks';
at: #answer put: 42;
yourself."JsonObject instances are like dictionaries
that use DoesNotUnderstand to set their values:"
theUniverseAndEverything := JsonObject new
theQuestion: 'Questioner asks';
answer: 42;
yourself."And then you can:"
theUniverseAndEverything asJSONString.
'{"answer"":42,"theQuestion":"Questioner asks"}'
```## Load from Playground
```smalltalk
Metacello new
baseline:'JSON';
repository: 'github://sebastianconcept/JSON:latest/src';
load.
```## Load as dependency
```smalltalk
spec
baseline: 'JSON'
with: [ spec
loads: #('JSON');
repository: 'github://sebastianconcept/JSON:latest/src' ]
```