Re: divide & conquer algorithm to implement string matching



misterio <giagimari@xxxxxxxxx> writes:

On 29 Mag, 18:31, Pascal Bourguignon <p...@xxxxxxxxxxxxxxxxx> wrote:
It wasn't supposed to be lisp, but some kind of pseudo-code.
I'm sorry,so maybe I should ask for a non-
functional,imperative,language or pseudocode :)
Anyway,thank you for your help,the fact that I don't understand that
language is only my fault.

No, more the fault of the lacking education systems ;-)

But it's rather easy to read, as pseudocode.

Function calls are written: (function argument...)
(instead of perhaps the more habitual function(argument,...)).

(if test
then
else)

translate to:

IF test THEN
then
ELSE
else
ENDIF




(cond (test-1 then-1)
(test-2 then-2)
...)

translates to:

IF test-1 THEN
then-1
ELSIF test-2 THEN
then-2
....
ENDIF


AND and OR are short-cutting.

LET introduce local lexical variables.

(let ((var-1 val-1)
(var-2 val-2)
...)
body...)

translates to:

VAR
var-1 = val-1 ;
var-2 = val-2 ;
BEGIN
body ...
END


But frankly, I don't see the point for the more verbose forms...


--
__Pascal Bourguignon__ http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.
.