POV-Ray : Newsgroups : povray.pov4.discussion.general : Suggest v4.0 read only identifiers. (yuqk R15 v0.6.9.0) : Re: Suggest v4.0 read only identifiers. (yuqk R15 v0.6.9.0) Server Time
27 Jul 2024 12:35:10 EDT (-0400)
  Re: Suggest v4.0 read only identifiers. (yuqk R15 v0.6.9.0)  
From: ingo
Date: 30 Jun 2024 02:05:00
Message: <web.6680f5014bc5dc7517bac71e8ffb8ce3@news.povray.org>
"ingo" <nomail@nomail> wrote:

>
> Just as an example how it works in an other language. In the Nim programming
> language

I should have added one more option as it does what one can do with macro's.
Note there is now no output type specified and thus no return value. 'a' is
modified "in place".

proc dothing(a: var int, b: int) =
  a = a + b


var  a = 1
let  b = 2

dothing(a, b) # or a.dothing(b)

echo a  #printed result is sum of and b

ingo


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.