Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
12
Task/String-prepend/Prolog/string-prepend-1.pro
Normal file
12
Task/String-prepend/Prolog/string-prepend-1.pro
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
:- op(200, xfx, user:(=+)).
|
||||
|
||||
%% +Prepend =+ +Chars
|
||||
%
|
||||
% Will destructively update Chars
|
||||
% So that Chars = Prepend prefixed to Chars.
|
||||
% eazar001 in ##prolog helped refine this approach.
|
||||
|
||||
[X|Xs] =+ Chars :-
|
||||
append(Xs, Chars, Rest),
|
||||
nb_setarg(2, Chars, Rest),
|
||||
nb_setarg(1, Chars, X).
|
||||
Loading…
Add table
Add a link
Reference in a new issue