you have made my day :)
I'm very curious about the form and content of the "PSON", which could actually contain a program that would output PostScript. But I like this universe where all the time I spent on PostScript hacking would be useful now.
you have made my day :)
I'm very curious about the form and content of the "PSON", which could actually contain a program that would output PostScript. But I like this universe where all the time I spent on PostScript hacking would be useful now.
Just for fun, here's MDN's JSON example turned to PSON:
[
<<
/name (Molecule Man)
/age 29
/powers [ (Radiation resistance) (Turning tiny) ]
/inAlliance false
>>
<<
/name (Madame Uppercut)
/age 39
/powers [ (Million tonne punch) (Superhuman reflexes) ]
/inAlliance true
>>
]1. PDF has an "object table" so that you can refer to objects by number, permitting random access to the object graph, instead of requiring the whole file to be parsed from end to end.
2. PDF does permit comments, because not permitting comments would be a stupid idea.
3. PDF page contents are not represented as just a PSON object, but rather as a sequence of drawing operations.
By way of example, here's object 1750 from a random PDF file, which you can read in exactly the same way as your example above (so 37/T is two tokens: the integer 37 followed by the symbol T):
1750 0 obj
<</Linearized 1/L 791096/O 1752/E 12322/N 37/T 790286/H [ 483 540]>>
endobj
And here's some of the page contents from the same PDF, decompressed with Python zlib.decompress: 0.001 Tc -0.005 Tw -10.747 -1.02 Td
[(I)2(n)2(vest)1(men)2(t)1( )1(Co)2(n)2(f)1(eren)2(ce)]TJ
The TJ operator, as you can maybe guess, typesets a list of text strings interspersed with kerns, at the current point in the current font and so on.With the explicit dictionary stack, couldn't that be used to sandbox the scope and reach of these procedures?