Bytecode version of Stog, stog.byte, offers the ... ]]> function to evaluate code and display the result. This is nice to provide verified code examples on your pages.

Example: let mylist = [ 1 ; 2 ; 3 ; 4];; ]]> will display this: let mylist = [ 1 ; 2 ; 3 ; 4];;

Adding the toplevel="true" attribute will enable printing of the toplevel result, so let mylist = [ 1 ; 2 ; 3 ; 4];; ]]> will display this: let mylist = [ 1 ; 2 ; 3 ; 4];;

By default, ocaml-eval will stop Stog if an exception is raised when evaluating code. The error-exc attribute can be used to change this behaviour. By default it is "true", but giving this attribute another value will result in printing the raised exception instead of stopping Stog. This is useful when you want to show code raising exceptions, but still don't want to let other piece of code fail silently. let mylist = [ 1 ; 2 ; 3 ; 4];; let mylist2 = [ 1 ; 2 ; 3 ; "hello"];; ]]> will display this: let mylist = [ 1 ; 2 ; 3 ; 4];; let mylist2 = [ 1 ; 2 ; 3 ; "hello"];; Without error-exc="false", Stog would have failed with the OCaml error message.