Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/String-matching/TXR/string-matching-1.txr
Normal file
16
Task/String-matching/TXR/string-matching-1.txr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(tree-case *args*
|
||||
((big small)
|
||||
(cond
|
||||
((< (length big) (length small))
|
||||
(put-line `@big is shorter than @small`))
|
||||
((str= big small)
|
||||
(put-line `@big and @small are equal`))
|
||||
((starts-with small big)
|
||||
(put-line `@small is a prefix of @big`))
|
||||
((ends-with small big)
|
||||
(put-line `@small is a suffix of @big`))
|
||||
(t (iflet ((pos (search-str big small)))
|
||||
(put-line `@small occurs in @big at position @pos`)
|
||||
(put-line `@small does not occur in @big`)))))
|
||||
(otherwise
|
||||
(put-line `usage: @(ldiff *full-args* *args*) <bigstring> <smallstring>`)))
|
||||
26
Task/String-matching/TXR/string-matching-2.txr
Normal file
26
Task/String-matching/TXR/string-matching-2.txr
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
@line
|
||||
@(cases)
|
||||
@ line
|
||||
@ (output)
|
||||
second line is the same as first line
|
||||
@ (end)
|
||||
@(or)
|
||||
@ (skip)@line
|
||||
@ (output)
|
||||
first line is a suffix of the second line
|
||||
@ (end)
|
||||
@(or)
|
||||
@ line@(skip)
|
||||
@ (output)
|
||||
first line is a suffix of the second line
|
||||
@ (end)
|
||||
@(or)
|
||||
@ prefix@line@(skip)
|
||||
@ (output)
|
||||
first line is embedded in the second line at position @(length prefix)
|
||||
@ (end)
|
||||
@(or)
|
||||
@ (output)
|
||||
first line is not found in the second line
|
||||
@ (end)
|
||||
@(end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue