sub_string hack

This commit is contained in:
Vitor Santos Costa 2013-01-31 10:17:48 +00:00
parent 9ce268915d
commit 0e9641fe20

View File

@ -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), !,