Dirk Laurie on Mon, 01 Apr 2013 12:18:45 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Idiom: allocatemem in a script


If you have a script with `allocatemem` in it, the script
runs to completion if invoked by `gp myscript.gp`.
If invoked by `read("myscript.gp")` inside an interactive
session, it runs up to the first `allocatemem` and returns.

I've always thought of this behaviour as an undesirable
side effect of the implementation, but I have now come
to realize that it is a feature, not a bug.

It's a neat, clean way to separate the test code
in a module from the library code. So, even when
I don't need to change the stack size, I'm putting
`allocatemem` in from now on.