[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Changing the unit of an offset
From: |
Mohammad-Reza Nabipoor |
Subject: |
Re: [RFC] Changing the unit of an offset |
Date: |
Sun, 7 Feb 2021 12:33:37 +0330 |
Hi, Jose.
On Sat, Feb 06, 2021 at 12:53:42PM +0100, Jose E. Marchesi wrote:
>
> Hi people!
>
> David Faust has been writing some Poke, and was kind to give me a lot of
> feedback on the language.
>
> While using poke, he often found himself to look at the value of some
> given offset, but he would get it in bits:
>
> (poke) anoffset
> 128#b
>
> Now, if we wanted to see that offset in byts instead (or some other
> unit) we could do this:
>
> (poke) anoffet/#B
> 16
>
> But that gives us a magnitude, not an offset. It would of course be
> possible to write:
>
> (poke) (anoffset/#B)#B
> 16#B
>
> But that is too cumbersome.
>
> So, what about having some short convenient syntax to change the unit of
> an offset?
>
Do we really need a new syntax for this?
I see this situation as a UX problem for poke program and not the Poke
language.
What about changing the pretty-printer of offsets to print something like
this:
(poke) anoffset
(16#B) 128#b
Or some other forms.
If somebody really needs to change the offset type, he/she can use a normal
cast (using `as`).
Regards,
Mohammad-Reza