[Seed7-users] Pointer to function as argument
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
From: L. S. <lsp...@gm...> - 2020-11-16 21:15:31
|
Hi Just started learning seed7 a few days ago. Not totally convinced yet but it seems a useful language so far, much better than it's popularity suggests. 1. I'm currently trying to pass a pointer to a function to another function: tester(a,b,myfun(a,b)); const proc: tester (in var integer: a, in var integer: b, ref func integer: fun) is func local begin a := 10; b := 20; writeln("Value of fun: " <& fun); writeln("end"); writeln("inside: a = " <& a); writeln("inside: b = " <& b); end func; The arguments to "myfun" seems to be evaluated when calling tester or at compile time. How do I change the arguments 'a' and 'b' at runtime. 2. By curiosity I wonder why I can write: boolean parse "TRUE" but not writeln "something" [without parentheses!] |