Implement goalloc.
[goaljobs.git] / goaljobs-reference.pod
index 393e4b5..2ca27c7 100644 (file)
@@ -193,6 +193,21 @@ would print:
 
  my name is foo
 
+=head2 goalloc
+
+Inside goals, you can use C<goalloc> to get a printable source
+location of the goal, ie:
+
+ let goal foo () =
+   printf "%s\n" goalloc
+
+would print:
+
+ File "source.ml", line 2, characters 13-71 (end at line 3, character 23)
+
+Note that the actual string format depends on the internal OCaml
+function C<Loc.to_string> so it might change in future.
+
 =head2 onfail, onsuccess, onrun
 
 Inside goals you can register function(s) which run if the goal