[Cuis-dev] Bug in printing a BlockNode with only a nil inside and possible fix

Juan Vuletich juan at jvuletich.org
Wed Apr 8 11:56:12 PDT 2026


Hi Joel,

The issue is that

     m1 [nil]

and

     m2 []

both generate the same bytecodes. So making one of them consistent makes 
the other one inconsistent.

Something similars happens between

n1
     7 == nil
         ifTrue: [ 8 ]
         ifFalse: [ 9 ].


and

n2
     7
         ifNil: [ 8 ]
         ifNotNil: [ 9 ].

I'm not sure what to do here, if anything at all. Opinions?

Thanks,

On 2026-04-08 2:17 PM, Joel Camera via Cuis-dev wrote:
> Hi folks!
> I've found a bug when printing a BlockNode with a nil inside.
> When you have a method like
>
> m1 [nil]
>
> And in a Workspace print
>    (Clazz>>#m1) methodNode
> you'll see that the code printed will be
>  m1
>   [ ].
>
> I attached a possible solution in BlockNode>>printStatemetsOn:indent: 
> but, as I don't completely understand the code, perhaps the solution 
> could be different.
>
> Cheers
>
> <https://10pines.com/>
>
>
>   Joel Cámera
>
>
>     Agile Software Development
>
>
>   Alem 896, Floor 6, Buenos Aires, Argentina
>
>   +54 9 011 6091 3125
>
>
-- 
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260408/e209e01f/attachment.htm>


More information about the Cuis-dev mailing list