A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-mt.1664.mcz ==================== Summary ==================== Name: Morphic-mt.1664 Author: mt Time: 5 June 2020, 11:49:58.884634 am UUID: 8a563509-bb80-b34a-a723-9bcc1a586f10 Ancestors: Morphic-mt.1663 Proposal of different format to print integers in the object explorer. Print them in groups of, e.g., 4 digits, separated by a space character. I am sure that the actual implementation can be improved. :-) =============== Diff against Morphic-mt.1663 =============== Item was changed: ----- Method: Integer>>explorerContents (in category '*Morphic-Explorer') ----- explorerContents ^#( + ('hexadecimal' 16 4) + ('octal' 8 4) + ('binary' 2 4)) collect: [ :each | | label group | + group := each third. + label := self printStringBase: each second. + label := label padded: #left to: (label size roundUpTo: group) with: $0. + label := String streamContents: [:s | + 1 to: label size by: group do: [:index | + 1 to: group do: [:gIndex | + s nextPut: (label at: index + gIndex - 1)]. + s space]]. + - ('hexadecimal' 16) - ('octal' 8) - ('binary' 2)) collect: [ :each | ObjectExplorerWrapper + with: label - with: (self printStringBase: each second) name: each first translated model: self ]! |
Here is an example: Best, Marcel
|
> On 05.06.2020, at 11:51, Marcel Taeumel <[hidden email]> wrote: > > Here is an example: > Nice! Here's my thought: binary should be 4 or 8, octal 3 and hex 2 digits :) best regards -Tobias > > > Best, > Marcel >> Am 05.06.2020 11:50:15 schrieb [hidden email] <[hidden email]>: >> >> A new version of Morphic was added to project The Inbox: >> http://source.squeak.org/inbox/Morphic-mt.1664.mcz >> >> ==================== Summary ==================== >> >> Name: Morphic-mt.1664 >> Author: mt >> Time: 5 June 2020, 11:49:58.884634 am >> UUID: 8a563509-bb80-b34a-a723-9bcc1a586f10 >> Ancestors: Morphic-mt.1663 >> >> Proposal of different format to print integers in the object explorer. Print them in groups of, e.g., 4 digits, separated by a space character. >> >> I am sure that the actual implementation can be improved. :-) >> >> =============== Diff against Morphic-mt.1663 =============== >> >> Item was changed: >> ----- Method: Integer>>explorerContents (in category '*Morphic-Explorer') ----- >> explorerContents >> >> ^#( >> + ('hexadecimal' 16 4) >> + ('octal' 8 4) >> + ('binary' 2 4)) collect: [ :each | | label group | >> + group := each third. >> + label := self printStringBase: each second. >> + label := label padded: #left to: (label size roundUpTo: group) with: $0. >> + label := String streamContents: [:s | >> + 1 to: label size by: group do: [:index | >> + 1 to: group do: [:gIndex | >> + s nextPut: (label at: index + gIndex - 1)]. >> + s space]]. >> + >> - ('hexadecimal' 16) >> - ('octal' 8) >> - ('binary' 2)) collect: [ :each | >> ObjectExplorerWrapper >> + with: label >> - with: (self printStringBase: each second) >> name: each first translated >> model: self ]! >> >> > |
Like this? Best, Marcel
|
Maybe we could add this to Number -> "printing"? #printOn:base:group:? Best, Marcel
|
In reply to this post by marcel.taeumel
yes!
-t > On 05.06.2020, at 12:01, Marcel Taeumel <[hidden email]> wrote: > > Like this? > > > > Best, > Marcel >> Am 05.06.2020 11:59:19 schrieb Tobias Pape <[hidden email]>: >> >> >> > On 05.06.2020, at 11:51, Marcel Taeumel wrote: >> > >> > Here is an example: >> > >> >> >> Nice! >> >> Here's my thought: binary should be 4 or 8, octal 3 and hex 2 digits :) >> >> best regards >> -Tobias >> >> > >> > >> > Best, >> > Marcel >> >> Am 05.06.2020 11:50:15 schrieb [hidden email] : >> >> >> >> A new version of Morphic was added to project The Inbox: >> >> http://source.squeak.org/inbox/Morphic-mt.1664.mcz >> >> >> >> ==================== Summary ==================== >> >> >> >> Name: Morphic-mt.1664 >> >> Author: mt >> >> Time: 5 June 2020, 11:49:58.884634 am >> >> UUID: 8a563509-bb80-b34a-a723-9bcc1a586f10 >> >> Ancestors: Morphic-mt.1663 >> >> >> >> Proposal of different format to print integers in the object explorer. Print them in groups of, e.g., 4 digits, separated by a space character. >> >> >> >> I am sure that the actual implementation can be improved. :-) >> >> >> >> =============== Diff against Morphic-mt.1663 =============== >> >> >> >> Item was changed: >> >> ----- Method: Integer>>explorerContents (in category '*Morphic-Explorer') ----- >> >> explorerContents >> >> >> >> ^#( >> >> + ('hexadecimal' 16 4) >> >> + ('octal' 8 4) >> >> + ('binary' 2 4)) collect: [ :each | | label group | >> >> + group := each third. >> >> + label := self printStringBase: each second. >> >> + label := label padded: #left to: (label size roundUpTo: group) with: $0. >> >> + label := String streamContents: [:s | >> >> + 1 to: label size by: group do: [:index | >> >> + 1 to: group do: [:gIndex | >> >> + s nextPut: (label at: index + gIndex - 1)]. >> >> + s space]]. >> >> + >> >> - ('hexadecimal' 16) >> >> - ('octal' 8) >> >> - ('binary' 2)) collect: [ :each | >> >> ObjectExplorerWrapper >> >> + with: label >> >> - with: (self printStringBase: each second) >> >> name: each first translated >> >> model: self ]! >> >> >> >> >> > >> >> >> > |
Hi Marcel,
with the current Trunk version, I can copy the value of any of these representations and reevaluate it:
I just wanted to note that this won't be possible even longer if we start inserting spaces in that representation.
Btw, just for inspiration here is how they deal with this in C#: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-7.0/digit-separators Allow expressions like 2r10_1010 in Smalltalk? This would probably contrast with the minimality of the Smalltalk language. :-)
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von Tobias Pape <[hidden email]>
Gesendet: Freitag, 5. Juni 2020 12:59:18 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Inbox: Morphic-mt.1664.mcz yes!
-t > On 05.06.2020, at 12:01, Marcel Taeumel <[hidden email]> wrote: > > Like this? > > > > Best, > Marcel >> Am 05.06.2020 11:59:19 schrieb Tobias Pape <[hidden email]>: >> >> >> > On 05.06.2020, at 11:51, Marcel Taeumel wrote: >> > >> > Here is an example: >> > >> >> >> Nice! >> >> Here's my thought: binary should be 4 or 8, octal 3 and hex 2 digits :) >> >> best regards >> -Tobias >> >> > >> > >> > Best, >> > Marcel >> >> Am 05.06.2020 11:50:15 schrieb [hidden email] : >> >> >> >> A new version of Morphic was added to project The Inbox: >> >> http://source.squeak.org/inbox/Morphic-mt.1664.mcz >> >> >> >> ==================== Summary ==================== >> >> >> >> Name: Morphic-mt.1664 >> >> Author: mt >> >> Time: 5 June 2020, 11:49:58.884634 am >> >> UUID: 8a563509-bb80-b34a-a723-9bcc1a586f10 >> >> Ancestors: Morphic-mt.1663 >> >> >> >> Proposal of different format to print integers in the object explorer. Print them in groups of, e.g., 4 digits, separated by a space character. >> >> >> >> I am sure that the actual implementation can be improved. :-) >> >> >> >> =============== Diff against Morphic-mt.1663 =============== >> >> >> >> Item was changed: >> >> ----- Method: Integer>>explorerContents (in category '*Morphic-Explorer') ----- >> >> explorerContents >> >> >> >> ^#( >> >> + ('hexadecimal' 16 4) >> >> + ('octal' 8 4) >> >> + ('binary' 2 4)) collect: [ :each | | label group | >> >> + group := each third. >> >> + label := self printStringBase: each second. >> >> + label := label padded: #left to: (label size roundUpTo: group) with: $0. >> >> + label := String streamContents: [:s | >> >> + 1 to: label size by: group do: [:index | >> >> + 1 to: group do: [:gIndex | >> >> + s nextPut: (label at: index + gIndex - 1)]. >> >> + s space]]. >> >> + >> >> - ('hexadecimal' 16) >> >> - ('octal' 8) >> >> - ('binary' 2)) collect: [ :each | >> >> ObjectExplorerWrapper >> >> + with: label >> >> - with: (self printStringBase: each second) >> >> name: each first translated >> >> model: self ]! >> >> >> >> >> > >> >> >> >
Carpe Squeak!
|
It might be possible to augment the 'copy values' to pull out a better answer, such as 2r101010 when a number is showing '0010 1010'. All the data is there - it just might be a bit tricky getting to it. -cbc On Fri, Jun 5, 2020 at 4:46 AM Thiede, Christoph <[hidden email]> wrote:
|
I believe it would be confusing if 'copy values' did not copy exactly the displayed value, I fear ... Or is this just me? ;-)
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von Chris Cunningham <[hidden email]>
Gesendet: Freitag, 5. Juni 2020 17:38:04 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Inbox: Morphic-mt.1664.mcz It might be possible to augment the 'copy values' to pull out a better answer, such as 2r101010 when a number is showing '0010 1010'.
All the data is there - it just might be a bit tricky getting to it.
-cbc
On Fri, Jun 5, 2020 at 4:46 AM Thiede, Christoph <[hidden email]> wrote:
Carpe Squeak!
|
But it says 'copy values', not 'copy text' or 'copy string representation'... should we change the text? Eventually we might be able to put proper objects into the clipboard, what then? :-) Am Fr., 5. Juni 2020 um 19:26 Uhr schrieb Thiede, Christoph <[hidden email]>:
|
For now, you can try out this option if you load Tools-cbc.971.mcz from the inbox. On Fri, Jun 5, 2020 at 10:35 AM Jakob Reschke <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |