Find words whose first and last three letters are equal: Difference between revisions

add lambdatalk code
(Added AppleScript.)
(add lambdatalk code)
Line 585:
tartar
testes</pre>
 
=={{header|Lambdatalk}}==
<syntaxhighlight lang="scheme">
The unixdict.txt has been loaded from https://web.archive.org and stored in a wiki page, lib_UNIXDICT, from which it can be required on demand in any other one.
 
{require lib_UNIXDICT}
 
{def look
{lambda {}
{S.replace \s by {div} in
{S.map {lambda {:w}
{if {and {> {W.length :w} 5}
{W.equal? {W.slice 0 3 :w}
{W.slice -3 {W.length :w} :w} }}
then :w
else}} {S.replace else by el.se in UNIXDICT}} }}}
-> look
{look}
->
antiperspirant
calendrical
einstein
hotshot
murmur
oshkosh
tartar
testes
 
Note: Due to a "weakness" of the {if then else} special form, where the else separator is not protected, every occurences of the string "else" in the input text must be replaced by some "broken word" before the search, for instance "el.se" and restored after if necessary.
</syntaxhighlight>
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
99

edits