Last active
April 28, 2023 12:20
Making a common event using R48 internal stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import r48.io.IObjectBackend | |
import r48.io.data.IRIOFixnum | |
import r48.io.data.IRIO | |
import r48.io.r2k.dm2chk.DM2SparseArrayH | |
import r48.io.r2k.files.DatabaseIO | |
import r48.io.r2k.obj.ldb.CommonEvent | |
import r48.io.r2k.obj.ldb.Database | |
import java.io.FileOutputStream | |
IObjectBackend.Factory.encoding = "UTF-8" | |
// The r2k backend uses some complex packing/unpacking to save memory. | |
// This means touching it outside of the IRIO interface can lead to ... 'interesting side-effects', | |
// outside of controlled circumstances. | |
Database n = new Database() | |
IRIO ce = n.getIVar("@common_events").addHashVal(new IRIOFixnum(0)) | |
ce.getIVar("@name").setString("My Common Event") | |
FileOutputStream fos = new FileOutputStream("Hello.ldb") | |
DatabaseIO.writeLdb(fos, n) | |
fos.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is now out of date. For the better, at least -- much in the way of globals misuse was removed, for instance.