Git Product home page Git Product logo

Comments (9)

theseion avatar theseion commented on August 16, 2024

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.

jbrichau avatar jbrichau commented on August 16, 2024

@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.

jbrichau avatar jbrichau commented on August 16, 2024

Well... not the same issue but I should have the same issue actually after that commit... which is strange.

from seaside.

timrowledge avatar timrowledge commented on August 16, 2024

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.

timrowledge avatar timrowledge commented on August 16, 2024

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.

theseion avatar theseion commented on August 16, 2024

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.

timrowledge avatar timrowledge commented on August 16, 2024

I've added a suitable #asByteArray for squeak 6.1 trunk.

from seaside.

theseion avatar theseion commented on August 16, 2024

That's great, thanks. Did you use the implementation from Pharo (which used for Seaside)?

from seaside.

timrowledge avatar timrowledge commented on August 16, 2024

from seaside.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.