<div dir="ltr">Hi All!<div><br></div><div>I'm new to the world of RISC5 and Oberon</div><div><br></div><div>I'm curious about the dangers of using SYSTEM.VAL for casting or type conversion. I need to do bitwise operations on Integers and was planning on converting them to SETs using SYSTEM.VAL. However, <a href="https://en.wikibooks.org/wiki/Oberon/ETH_Oberon/faqlang#bitwise">this webpage</a> warns me to avoid using SYSTEM.VAL because it can break garbage collection, but I wasn't able to find any of Wirth's own documentation about it. I'm assuming that means that there is a potential for a memory leak if not used properly?</div><div><br></div><div>How can I make sure I'm using SYSTEM.VAL safely? Is the following example "safe"?</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">    PROCEDURE SetVal*(val : INTEGER);<br>    (* only values between 0 and 99 are valid*)<br>        VAR digit1, digit2 : SET;<br>    BEGIN<br>        (* Convert the integer into 2 binary-coded decimal digits*)<br>        digit1 := SYSTEM.VAL(SET, val DIV 10);<br>        digit2 := SYSTEM.VAL(SET, val MOD 10);<br>        digit1 := LSL(digit1, 4);<br>        SYSTEM.PUT(SEVENSEGADR, digit1 + digit2);<br>    END SetVal;</blockquote><div><br></div><div><br></div></div>