Comments (9)
We could actually just copy the implementation from Pharo, which uses primitive 62 to compute the number of bytes in large integers.
I suppose I would implement #greaseAsByteArray
on Integer
and subclasses, as required, where the Pharo version would simply dispatch to Integer>>#asByteArray
, right @jbrichau?
from seaside.
@theseion hm... I think we should do that yes. I had the same issue in GemStone (see 95d0f2e) but now I do not understand entirely because Integer>>asByteArray
still does not exist in GemStone. I guess there is some other package being loaded that adds it... so there is an issue here for both Squeak and GemStone currently, which makes Grease the best place to tackle the difference.
from seaside.
Well... not the same issue but I should have the same issue actually after that commit... which is strange.
from seaside.
There may be more to this than initially meets the eye. Squeak really should have #asByteAray for integers since it is sent in Magnitude>>#putOn: which gets used in writing values to assorted streams. Some of which can be set to binary (file streams, for example) andwhich would fail with any sort of number.
from seaside.
It turns out that #asByteArray is really rather trivial for LargePositiveInteger -
myLargePositiveInteger as: ByteArray
will do it.
Hacking that trivially into #entityTagFor: to test makes all the nice formatting come back.
from seaside.
Yes, it's weird that that method isn't there. I looked back as far as I could (5.2 only, unfortunately) and it's not there. There's a PR in the works that adds Grease support for all platforms (GemStone has the same issue).
from seaside.
I've added a suitable #asByteArray for squeak 6.1 trunk.
from seaside.
That's great, thanks. Did you use the implementation from Pharo (which used for Seaside)?
from seaside.
from seaside.
Related Issues (20)
- testCORSFilterFunctionalTest is broken on github CI HOT 3
- JQAjax>>#callback:json: and invalid json HOT 9
- Dictionary>>#asJson does not produce valid JSON when using integer keys HOT 6
- WAGettextExporter catalog generation issues
- It is not fully clear why the session cache settings are described two times at /config
- WAPharoInspector cannot evaluate (compile) expressions in Pharo 11 HOT 1
- WAFastCGIAdaptor doesn’t write cookie attributes ‘Max-Age’ and ‘SameSite’ HOT 2
- WAFastCGIRequestConverter>>#requestUrlFor: signals a WAInvalidUrlSyntaxError when the ‘REQUEST_URI’ is ‘/?://’
- Nested script tags are not properly escaped HOT 2
- PackageManifest extensions should not be loaded in Squeak HOT 4
- Squeak WAVNCController>>#uiProcess should use Project, not UIManager
- Squeak has no #isImmediateObject HOT 4
- Squeak needs variant implementation of #openDebuggerOn: HOT 3
- Squeak WAVersionUploader>>#newVersion: needs to make sure the RWBinaryOrTextStream is ascii HOT 2
- Squeak WAWebServerAdaptor>>#responseFrom: sends #oldNetscapeString HOT 3
- WAAdmin clearSessions does not clear sessions on GemStone
- Squeak needs version of WAInspector HOT 1
- Squeak WAVNCController>>#renderContentOn: needs to test existence of a vnc server before asking if it is running HOT 2
- WAServerAdaptor>>#handlePadding: needed anymore ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seaside.