Is it possible to install newLISP somehow via yum or any other automatic manager?
Or I should download sources and compile newLISP manually?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
'((1 Oil 2)
(1 Oil 5)
(1 Oil 7)
(2 Gas 4)
(2 Gas 12))
'((1 Oil 2 5 7)
(2 Gas 4 12))
(find-all "12" "12345" (replace "1" (copy $0) "N"))
> (find-all "(?<=,)[^,]*(?=,)" ",1,10,,100,1000,")
("1" "10" "")
("1" "10" "" "100" "1000")
(map decode-utf8-to-cp1251 (directory "."))
10 CLS
20 PRINT "2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97"
30 END
(define (prime? x) (= (first (factor x)) x))
(println (filter prime? (sequence 2 100)))
(define (primes n , p)
(dotimes (e n)
(if (= (length (factor e)) 1)
(push e p -1))) p)
> {some symbols /""}
"some symbols \/"""
(define (gnirts-lave x)
(1 -1 (string (list x))))
> (time (sleep 3600000))
1,844674407e+016
> (time (read-file "100_13.txt") 70)
0
> (time (read-file "100_13.txt") 80)
0
> (time (read-file "100_13.txt") 90)
15,625
> (time (read-file "100_13.txt") 90)
0
> (time (read-file "100_13.txt") 90)
15,625
(0 100 '("Some" "long" "list"))
returns me first 100 dwellers of the list.
(-100 100 '("Some" "long" "list"))
says: "ERR: list index out of bounds" if the list is not long enough. But same expression works ok with strings).
(define (push-cut what where how-long)
(push what where)
(if (> (length where) how-long)
(set 'where (0 how-long where)))
0)
(define-macro (curry-all f)
(letex (f1 f lst (map string (args)))
(fn (z) (eval-string (append "(" (name 'f1) " " (join 'lst " ") " " (name 'z) ")")))))
((curry-all + 1 2 3 4) 5)
> 15
(set 'mylist '((0 0) '(0 1) '(0 2)))
(amb mylist)
(eval-string (append "(amb '" (join (map string mylist) " '") ")"))
(println (upper-case "абвгдеёжзийклмнопрстуфхцчшщъыьэюя"))
"ࡢ㤥¸槨骫м®п°±гґµзё№мЅѕ"
"АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"
(define (sacar-td linea)
(set 'alveolos (find-all "(<td)(.*?)(</td>)" linea $0 1))
(map (fn (x) (replace "</?td(.*?)>" x "" 1)) alveolos))
(define (crash-td linea)
(find-all "(<td)(.*?)(</td>)" linea (replace "</?td(.*?)>" $0 "" 1) 1))
(set 'testrow "<tr><td class='kin'>Alpha</td><td>Gamma</td></tr>")
; Usage (parse-html (get-url "http://www.newlisp.org/downloads/newlisp_manual.html"))
(define (parse-html texto)
(map sacar-table (find-all "(?s)(<table)(.*?)(</table>)" texto $0 1)))
(define (sacar-td linea)
(set 'alveolos (find-all "(<t[dh])(.*?)(</t[dh]>)" linea $0 1))
(map (fn (x) (replace "</?t[dh](.*?)>" x "" 1)) alveolos))
(define (sacar-table linea)
(map sacar-td (find-all "(?s)(<tr)(.*?)(</tr>)" linea $0 1)))
(define (add-tail tl str)
(append str tl))
(map (add-tail "-Schwanz") '("Hund" "Katze" "Pinguin"))
(map add-tail (dup "-Schwanz" 3 true) '("Hund" "Katze" "Pinguin"))
; Usage: (cyr-win-utf "text in windows-1251 encoding")
; Decodes text from windows-1251 to utf-8
(define (cyr-win-utf t-linea)
; Loading encoding table
(set 'en-win-1251 '((255 "я") (254 "ю") (253 "э") (252 "ь") (251 "ы")
(250 "ъ") (249 "щ") (248 "ш") (247 "ч") (246 "ц") (245 "х") (244 "ф")
(243 "у") (242 "т") (241 "с") (240 "р") (239 "п") (238 "о") (237 "н")
(236 "м") (235 "л") (234 "к") (233 "й") (232 "и") (231 "з") (230 "ж")
(184 "ё") (229 "е") (228 "д") (227 "г") (226 "в") (225 "б") (224 "а")
(223 "Я") (222 "Ю") (221 "Э") (220 "Ь") (219 "Ы") (218 "Ъ") (217 "Щ")
(216 "Ш") (215 "Ч") (214 "Ц") (213 "Х") (212 "Ф") (211 "У") (210 "Т")
(209 "С") (208 "Р") (207 "П") (206 "О") (205 "Н") (204 "М") (203 "Л")
(202 "К") (201 "Й") (200 "И") (199 "З") (198 "Ж") (168 "Ё") (197 "Е")
(196 "Д") (195 "Г") (194 "В") (193 "Б") (192 "А")))
; saving string to a temp file
(set 't-file-name (append "/tmp/" (crypto:md5 (string (random)))))
(write-file t-file-name t-linea)
; loading characters to the t-out
(set 't-out "")
(set 't-file (open t-file-name "read"))
(while (set 't-char (read-char t-file))
(push (or (lookup t-char en-win-1251) (char t-char)) t-out -1))
(close t-file)
t-out)
(define (meter)
(dolist (x (args))
(push (string x) cuerpo -1)))
(push "<td>" cuerpo -1)
(define (meter-2 arg-1)
(push arg-1 cuerpo -1))
<group>
<group>
<element>
</group>
<element>
</group>
(("group" ("group" ("element" (("code" "1")))) ("element" (("code" "2")))))
(assoc '("code" "2") xml-list)