Lisp > Perl
2
Name:
Anonymous
2012-01-06 21:08
Lisp Perl
3
Name:
Anonymous
2012-01-06 21:32
perlisp lisperl
4
Name:
Anonymous
2012-01-06 21:39
Perl is much better than lisp. I had a fan of lisp tell me that it didn't matter that you could write stronger programs out of the box with certain languages. Evidently the libraries available for each language don't matter and "Lisp could have regexes just as powerful as Perl with the right libraries".
Really? Well where are these libraries that give lisp the same ability to manipulate strings as Perl?
5
Name:
Anonymous
2012-01-06 22:34
>>4
$var =~ /^#include\s*<([^>]+)>/;
$file_name = $1;
(match var (regex (concat beginning-of-line
"#include"
(zero-or-more-of white-space)
"<"
(save-contents-as file-name (one-or-more-of (any-char-but #\>)))
">")))
6
Name:
Anonymous
2012-01-06 23:01
or alternatively,
(match var (^ #include (* \s) < (save file-name (+ ([^ >))) >)
7
Name:
Anonymous
2012-01-06 23:19
>>5
#include <regex.h>
#include <stdio.h>
int main() {
char *var = NULL, *file_name = "";
int n = 0;
regex_t pat;
regmatch_t matchbuf[1];
getline(&var, &n, stdin);
regcomp(&pat, "^#include[[:space:]]*<([^>]+)>", REG_EXTENDED);
regexec(&pat, var, 1, matchbuf, 0);
if (matchbuf->rm_so != -1) {
&var[matchbuf->rm_eo] = '\0';
file_name = strdup(&var[matchbuf->rm_so]);
}
free(var);
}
8
Name:
Anonymous
2012-01-07 0:00
why do lispers care about perl?
seriously check out the stats of Comp.Lang.Lisp against Comp.Lang.Perl refering to the citation of the other language.
lisper care too much about it
9
Name:
Anonymous
2012-01-07 1:40
10
Name:
Anonymous
2012-01-07 2:57
>>5,6
Still waiting for you to show me how lisp can manipulate strings as well as perl...
11
Name:
Anonymous
2012-01-07 3:13
>>10
(run-program "perl" '("/path/to/perl_script.pl") :input :stream)
12
Name:
Anonymous
2012-01-07 5:22
13
Name:
Anonymous
2012-01-08 3:13
>>5
($filename) = $var =~ /^#include\s*<([^>]+)>/;
FTFY
14
Name:
Anonymous
2012-01-08 4:40
>>13
Well that is convenient. thanks for helping me in my quest to
become a perl ninja
15
Name:
Anonymous
2012-01-08 5:45
not like the real world cares about either.
16
Name:
Anonymous
2012-01-08 8:35
GC is shit.
17
Name:
Anonymous
2012-01-08 9:35
>>15
That's because The Real World™ is not interested in anything more than robotic code monkeys.