Git Product home page Git Product logo

Comments (8)

7sharp9 avatar 7sharp9 commented on May 24, 2024 3

Its not opinionated its just the standard format for hex bytes. Anything else would be opinionated and specific. If theres an option for binary formatted bytes then why not a hex format.

from fsharp.

Thorium avatar Thorium commented on May 24, 2024 1

Could it be possible to do something like .ToString("H") or is that all coming from .Net side?

When you are e.g. debugging a byte array content, you would need something that is already there, not needing to trust a random intrnet site still has maybe a working part you have to plugin to your source code.

from fsharp.

Thorium avatar Thorium commented on May 24, 2024 1

fsi output for any array should definitely stay [|...; ...; ...|].

String is a seq of characters and still the fsi output is not like [| 72; 101; 108; 108; 111; 32; 87; 111; 114; 108; ... |].
Why? Because no-one finds that useful, exactly like bytes [|116uy; 104uy; ... |] .

from fsharp.

vzarytovskii avatar vzarytovskii commented on May 24, 2024

We're unlikely to take it to standard library (FSharp.Core), it's too specific and opinionated. It belongs to some sort of helpers library/module, now the question if we want to ship something like it alongside the fsi? Fsi printing is extensible, so shouldn't be a problem to just have a DLL for it?

from fsharp.

vzarytovskii avatar vzarytovskii commented on May 24, 2024

Its not opinionated its just the standard format for hex bytes.

Right, in hex editor, where you can render it by columns and synchronise cursor between them, so it's actually useful.

In F# REPL I prefer to see closer to how it would've been defined, so I can copy easily and do something with it.

Does any other REPL have this as standard output?

from fsharp.

7sharp9 avatar 7sharp9 commented on May 24, 2024

What Im saying is viewing bytes in hex is not opinionated, its a very sensible and standard way of viewing bytes. In my emulator code I use this too:

let mpf68901 = 0xFFFA00u

etc, it would be extremely unnatural to use ints

from fsharp.

vzarytovskii avatar vzarytovskii commented on May 24, 2024

What Im saying is viewing bytes in hex is not opinionated, it's a very sensible and standard way of viewing bytes.

What I meant is that it can be confusing as standard view option in repl, but fine as a function/method, but we don't really have a standardised way of shipping such helpers with fsi.

from fsharp.

Martin521 avatar Martin521 commented on May 24, 2024

Indeed the above getBytesTable is a nice helper function for building specific tools. But the standard fsi output for any array should definitely stay [|...; ...; ...|].
fssnip.net is a good place to post / search such functions.

from fsharp.

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.