SWI-Prolog newbie instantiation?

From: Pnewbie (ggroups2_at_yahoo.com)
Date: 08/08/04


Date: 7 Aug 2004 22:21:44 -0700

Ok, Can someone tell me what how this works?

extractor(String, Result) :- append(Pre, Post, String), append(" ",
Middle, Post), Result is Middle.

When String is something like "this is a", what are the values of all
those variables. (I cant get it to display the variables at run time,
I will just get [23, 24, 68] or something like that.) Also is it
possible to modify this so that you can extract between two different
characters? I think I need to add two more appends right?

I find the tracer pretty useless, it never gives me the strings but
stuff like

Exit: (8) lists:append([], [62, 48, 44, 49], [62, 48, 44, 49]) ?
creep
Call: (8) lists:append([32], _L219, [62, 48, 44, 49]) ? creep
Fail: (8) lists:append([32], _L219, [62, 48, 44, 49]) ? creep



Relevant Pages

  • Re: Algorithmic Randomness is Universal (Was Re: Godels Dualism ...)
    ... > This comment is useless as it stands because it is not generally true. ... > independent of the length of x, the string to be compressed. ... As with computational complexity, Kolmogorov complexity is ... > definition of algorithmic randomness is not universal, ...
    (comp.theory)
  • Re: horizontal join of array elements
    ... > my $arr; ... You don't need $clean string in this scope. ... Useless use of quotes. ...
    (comp.lang.perl.misc)
  • Re: How do you write "or"
    ... operator is useless, since it's inside the string. ... seems no need to keep writing the if bit. ...
    (alt.php)
  • free() is useless...
    ... Well, it's not useless, it just doesn't seem to be working for me. ... Basically, when I'm returning a pointer from a function, free does not ... return string; ... is evident b/c the software is a high volume socket server and I can ...
    (comp.lang.c)
  • Fwd: Port perl 5.8.7 on FreeBSD 4.10
    ... Port perl 5.8.7 on FreeBSD 4.10 ... > OK part of it may be useless:) ... Backup the value of LD_LIBRARY_PATH (just copy the string in a text ...
    (freebsd-questions)