-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Squeak does not have an implementation of Integer>>#asByteArray #1383
Comments
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 |
@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 |
Well... not the same issue but I should have the same issue actually after that commit... which is strange. |
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. |
It turns out that #asByteArray is really rather trivial for LargePositiveInteger - |
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). |
I've added a suitable #asByteArray for squeak 6.1 trunk. |
That's great, thanks. Did you use the implementation from Pharo (which used for Seaside)? |
No idea on that - I just used the simplest possible Squeak mechanism. It's a bit crazy really since a large integer is just a byte array!
On 2023-10-30, at 11:55 PM, Max Leske ***@***.***> wrote:
That's great, thanks. Did you use the implementation from Pharo (which used for Seaside)?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
tim
--
tim Rowledge; ***@***.***; http://www.rowledge.org/tim
After a number of decimal places, nobody gives a damn.
|
WAAbstractFileLibrary>>#entityTagFor:
sends#asByteArray
to aLargePositiveInteger
, which causes and MNU in Squeak. This causes errors when accessing jQuery files (no styling visible on pages).I've come up with a quick fix version but it lacks VM support as in Pharo:
The text was updated successfully, but these errors were encountered: