String matching: Difference between revisions
m
→TXR Lisp: Drop @(do ...); rename script to cmatch2.tl
(→{{header|Fortran}}: added modern fortran version) |
m (→TXR Lisp: Drop @(do ...); rename script to cmatch2.tl) |
||
Line 2,757:
===TXR Lisp===
<lang
((big small)
((< (length big) (
(put-line `@big is shorter
(put-line `@big and @small
(put-line `@small is a
(put-line `@small is a
(t (let
(
(put-line `@small occurs
▲ (otherwise
▲ (put-line `usage: @(ldiff *full-args* *args*) <bigstring> <smallstring>`))))</lang>
{{out}}
<pre>$ txr cmatch2.
usage: txr cmatch2.
$ txr cmatch2.
usage: txr cmatch2.
$ txr cmatch2.
cat is a prefix of catalog
$ txr cmatch2.
log is a suffix of catalog
$ txr cmatch2.
at occurs in catalog at position 1
$ txr cmatch2.
catalog is shorter than catalogue
$ txr cmatch2.
catalog and catalog are equal
$ txr cmatch2.
dog does not occur in catalog</pre>
|