From 0e9641fe208e50121194d4c95f506fe0c06189aa Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 31 Jan 2013 10:17:48 +0000 Subject: [PATCH] sub_string hack --- pl/utils.yap | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pl/utils.yap b/pl/utils.yap index 6f9e5751f..953675ab6 100644 --- a/pl/utils.yap +++ b/pl/utils.yap @@ -449,6 +449,17 @@ atomic_concat(X,Y,At) :- name(X, Xs), name(Y, Ys). + +% +% small compatibility hack +% +sub_string(String, Bef, Size, After, SubStr) :- + catch(string_to_atom(String, A), _, true), + catch(string_to_atom(SubStr, SubA), _, true), + sub_atom(A, Bef, Size, After, SubA), + catch(string_to_atom(String, A), _, true), + catch(string_to_atom(SubStr, SubA), _, true). + sub_atom(At, Bef, Size, After, SubAt) :- % extract something from an atom atom(At), integer(Bef), integer(Size), !,