Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Lisp > Perl

Name: 2012-01-06 20:42

Name: Anonymous 2012-01-06 21:08

Lisp Perl

Name: Anonymous 2012-01-06 21:32

perlisp lisperl

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?

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 #\>)))
                          ">")))

Name: Anonymous 2012-01-06 23:01

or alternatively,


(match var (^ #include (* \s) < (save file-name (+ ([^ >))) >)

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);
}

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

Name: Anonymous 2012-01-07 1:40

>>7

nice.

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...

Name: Anonymous 2012-01-07 3:13

>>10
(run-program "perl" '("/path/to/perl_script.pl") :input :stream)

Name: Anonymous 2012-01-07 5:22

Name: Anonymous 2012-01-08 3:13

>>5
($filename) = $var =~ /^#include\s*<([^>]+)>/;

FTFY

Name: Anonymous 2012-01-08 4:40

>>13

Well that is convenient. thanks for helping me in my quest to become a perl ninja

Name: Anonymous 2012-01-08 5:45

not like the real world cares about either.

Name: Anonymous 2012-01-08 8:35

GC is shit.

Name: Anonymous 2012-01-08 9:35

>>15
That's because The Real World™ is not interested in anything more than robotic code monkeys.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List