ipl/packs/loadfuncpp/examples/callicon.icn
raw| 1 | |
| 2 | link loadfuncpp |
| 3 | |
| 4 | procedure main() |
| 5 | icall := loadfuncpp("./callicon.so", "iexample") |
| 6 | |
| 7 | write( icall(f, ["Argument passed"]) ) |
| 8 | end |
| 9 | |
| 10 | procedure f(arg) |
| 11 | write(arg) |
| 12 | write("Called from C++") |
| 13 | every write( g(arg) ) |
| 14 | x := create g(arg) |
| 15 | while writes(@x) |
| 16 | write() |
| 17 | return "Result string!" |
| 18 | end |
| 19 | |
| 20 | procedure g(arg) |
| 21 | suspend !arg |
| 22 | end |
| 23 | |
| 24 |