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

Pages: 1-

Lisp as a shell language

Name: Anonymous 2012-02-25 19:51

has anyone here used CL or Scheme as a shell to create/move/delete directories and files. List directory contents, change directories, all the things you do with a shell language. I know emacs has most of this functionality, but I want to be able to use Lisp alone.

Name: Anonymous 2012-02-25 19:54

NO BECAUSE I'M NOT FUCKING RETARDED okay I lie I just don't see the reason to reinvent something that's already in place

Name: Anonymous 2012-02-25 19:59

>>2
bash is ok for simple tasks, but for any complex scripting it is the absolute shittiest scripting language which is why any sys admin worth his salt uses perl or python. but I like Lisp better than perl or python

Name: Anonymous 2012-02-25 20:31

Name: Anonymous 2012-02-25 21:42

>>4
perfect

Name: Anonymous 2012-02-25 23:47

perlfect

Name: Anonymous 2012-02-26 0:42

perlfect

Name: Anonymous 2012-02-26 12:02

Yes. CL has functionality for this in the standard, although it's designed to be portable across many types of filesystems (such as those over networks, or various non-UNIX/non-Windows-like ones that existed when it was first designed), so it's a bit over-engineered - in practice you might want to write a small library that makes things easier for your target platforms, or use one of the available ones. There's also some POSIX APIs if you prefer using that instead. Also, many libraries/portability layers that make stuff easier (such as osicat and cl-fad). Look at this: http://www.cliki.net/system%20programming

Name: Anonymous 2012-02-26 16:09

>>5
64

Name: Anonymous 2012-02-26 16:57

Lisp is fucking unreadable shit.

Name: Anonymous 2012-02-26 17:30

check 'em

Name: Anonymous 2012-02-26 21:57

>>11
chkd

Name: Anonymous 2012-02-26 23:26

>>10
At least it's better than (Java|Go|D|PHP|JavaScript).

Name: Anonymous 2012-03-06 17:28

>>13
[spoiler]Or is it?

Name: Anonymous 2012-03-06 17:59

Stupid idea. No one would want to write (ls) instead of just ls.

Name: Anonymous 2012-03-06 18:13

>>15
Okay, let's say the outermost parentheses get added automatically. How about now?

Name: Anonymous 2012-03-06 20:57

>>16
Better idea: unmatched parentheses are automatically matched by inserting the required number at the beginning and end of each line.
print-directory-entries) ;``ls'' is un-lispy as fuck
print-directory-entries
(print-directory-entries
(print-directory-entries)

Name: Anonymous 2012-03-07 0:09

>>10
Just because you're unwilling to try doesn't mean it's Lisp's fault.

>>13
JavaScript is an extremely powerful functional programming language disguised as a pile of rubbish. Don't underestimate it because of its "impurity".


I wish if there were something like >>4 for Windows. But either way, as long as forking in Windows is crippled, it will never be like in Linux.

Name: Anonymous 2012-03-07 4:07

look into emacs-shell. its a shell written completley in emacs lisp. so basically every function in emacs is available in the language. about 2000 functions. you will never use them all. its super powerful. its better than perl as a text processing language.

scheme schell isnt really actively developed.

Name: Anonymous 2012-03-07 4:28

>>15
I do.

Name: Anonymous 2012-03-07 5:04

>>17
Nice idea. But what about pipes? Maybe we should support "|". For example ps 'a | grep 'o "bash" | kill would expand into (kill (grep 'o bash (ps 'a)))

Name: Anonymous 2012-03-07 5:05

>>21
And still pipes should act as lazy-lists, so that one could easily use map and fold on them.

Name: Anonymous 2012-03-07 14:45

>>21
Looks like bash to me.

Name: >>18 2012-03-08 0:31

>>19
Incredible!

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