Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Scheme and VI
From previous threads it looks like one can be a functional language
guy and a VImer at the same time. Could you please tell me how do you
send your selections/buffers from your favorite VI clone to the interpreter?

--

Thanks,
Karel Miklav

Report this thread to moderator Post Follow-up to this message
Old Post
Karel Miklav
05-19-05 01:59 AM


Re: Scheme and VI
Karel Miklav wrote:

> From previous threads it looks like one can be a functional language guy
> and a VImer at the same time. Could you please tell me how do you send
> your selections/buffers from your favorite VI clone to the interpreter?

I've given up and use XEmacs for that (I'm a 10+ years heavy vi user
otherwise but have been using emacs on and off over the time aswell so
it hasn't really been alien to me).  However, in that regard, emacs is
hardly optimal and only a small step up from what the vi clones offer,
in functionality.  One of the major drawbacks, apart from the
all-permeating horror that is Emacs, is that you can only have one
Lisp/Scheme buffer running and have to start other Schemes in xterms (or
ordinary shell buffers) if you need more (which I usually do).

But for the vi camp... basically, if you have gvim (GUI version), it's
quite comfortable; just use ordinary cut&paste.  Works pretty well
(double-clicking on parens selects them and the enclosed text, also
available via keybindings).  Also, vim's Lisp/Scheme indentation is
quite well working (with the exception of parens in comments, which can
throw the matcher off track) and you can configure it a bit (via the
"lispwords" variable).  Original vi's also got a Lisp mode but it's very
primitive and not configurable and probably only of historical interest.
Some vi workalikes such as nvi or vile don't have a Lisp mode
implemented and are therefore only for those hardcore people who
consider automatically indented s-expressions licentious decadence.
Interacting with an interpreter in a terminal-only vi is painful, if the
stuff you paste is longer than a page, or if you cannot paste at all, so
I recommend using the gui version, if possible.

<rant>Unfortunately, gvim can open only one (1) gui window, which I find
pretty limited.  I never understood why they didn't give it the
possibility of opening multiple gui windows, like (X)Emacs, or virtually
any other GUI editor out there.  It's not that they're feature-averse,
quite the contrary, vim is a monstrous feature dump but apparently it's
either not easily doable within vim's architecture, or their brains are
simply ticking differently from mine and they don't consider it
important enough.</rant>

mkb.

Report this thread to moderator Post Follow-up to this message
Old Post
Matthias Buelow
05-19-05 01:59 AM


Re: Scheme and VI
Matthias Buelow <mkb@incubus.de> writes:

> One of the major drawbacks, apart from the all-permeating horror
> that is Emacs, is that you can only have one Lisp/Scheme buffer
> running and have to start other Schemes in xterms (or ordinary shell
> buffers) if you need more (which I usually do).

Nope, use M-x rename-buffer, rename the scheme buffer, then start a
new one with M-x run-scheme. Good luck with Emacs!

Sunnan
--
.i mi'e snan .i mi rodo roda fraxu

Report this thread to moderator Post Follow-up to this message
Old Post
Sunnan
05-19-05 09:00 AM


Re: Scheme and VI
Karel Miklav wrote:
>  From previous threads it looks like one can be a functional language
> guy and a VImer at the same time. Could you please tell me how do you
> send your selections/buffers from your favorite VI clone to the
> interpreter?

I think with "!" you can send several lines from the buffer to a
program.  That program could for instance pipe its stuff to the
interpreter, via a named pipe etc. (so you would run scheme as
"scheme < named-pipe").  Well, then there's that input problem
again, so maybe you need another program inbetween that reads from
both stdin and the pipe...

Happy C coding ;)

--
Don't let school interfere with your education. -- Mark Twain

Report this thread to moderator Post Follow-up to this message
Old Post
Ulrich Hobelmann
05-19-05 09:00 AM


Re: Scheme and VI
Karel Miklav wrote:
>  From previous threads it looks like one can be a functional language=20
> guy and a VImer at the same time. Could you please tell me how do you=20
> send your selections/buffers from your favorite VI clone to the=20
> interpreter?

I haven't tried it, but this version of VI might be interesting:

<http://iamphet.nm.ru/scheme/>

--=20
Jens Axel S=F8gaard


Report this thread to moderator Post Follow-up to this message
Old Post
Jens Axel Søgaard
05-19-05 01:57 PM


Re: Scheme and VI
Karel Miklav <karel@lovetemple.adbloccker.net> wrote:
>  From previous threads it looks like one can be a functional language
> guy and a VImer at the same time. Could you please tell me how do you
> send your selections/buffers from your favorite VI clone to the interpreter?[/colo
r]

Use two xterms: one for editing in vi, one running the Scheme interpreter.
To run your code, save, switch windows, load the file into the interpreter
and run.

To evaluate a single expression, use '!%interpreter' and 'u'. '!%' sends
everything between two matching parens to 'interpreter'. The 'u' undoes
the previous command.

Nils

--
Nils M Holm <nmh@despammed.com>         http://www.holm-und-jeschag.de/nils/
Symbolic Computing - an Introduction to Pure LISP: http://www.t3x.org/scipl/

Report this thread to moderator Post Follow-up to this message
Old Post
Nils M Holm
05-19-05 01:57 PM


Re: Scheme and VI
Matthias Buelow wrote:
> <rant>Unfortunately, gvim can open only one (1) gui window, which I find
> pretty limited.  I never understood why they didn't give it the
> possibility of opening multiple gui windows, like (X)Emacs, or virtually
> any other GUI editor out there.

I remember using the Project + Minibufexpl scripts at the same - real
window managing nightmare. Maybe that's what bothers you?

Report this thread to moderator Post Follow-up to this message
Old Post
Karel Miklav
05-19-05 01:57 PM


Re: Scheme and VI
Ulrich Hobelmann wrote:
> I think with "!" you can send several lines from the buffer to a
> program.  That program could for instance pipe its stuff to the
> interpreter, via a named pipe etc.

There are named pipes? Wow, that gives my I/O redirection fiddlings a
new dimension :) Anyway, I'm glad I asked, lots of interesting replies.
Thanks Ulrich, thanks people.

Karel Miklav

Report this thread to moderator Post Follow-up to this message
Old Post
Karel Miklav
05-19-05 01:57 PM


Re: Scheme and VI
Karel Miklav wrote:
> From previous threads it looks like one can be a functional language guy
> and a VImer at the same time. Could you please tell me how do you send
> your selections/buffers from your favorite VI clone to the interpreter?
>
> --
>
> Thanks,
> Karel Miklav

Hi,

In most cases the following command fits your needs (works with vim,
don't know other implementations).

:w !myschemeinterpreter

This works for guile at least:

:w !guile

It passes the content of the current buffer via stdout into the
interpreter myschemeinterpreter. (Attention, there is a space in front
of the !)

:w !! repeats the last :w !app command

(This does not save your work though, so be sure to save your files)

Alternatively, you can run normal shell commands:

:!myschemeinterpreter interpreter-params

:!! repeats the last :!... command

so regularly, I use

:!guile -s myfile.scm

Holger

Report this thread to moderator Post Follow-up to this message
Old Post
Holger Peters
05-19-05 01:57 PM


Re: Scheme and VI
On Thu, 19 May 2005 01:04:31 +0200, Matthias Buelow wrote:

> Karel Miklav wrote:
> 
>
> I've given up and use XEmacs for that (I'm a 10+ years heavy vi user
> otherwise but have been using emacs on and off over the time aswell so
> it hasn't really been alien to me).  However, in that regard, emacs is
> hardly optimal and only a small step up from what the vi clones offer,
> in functionality.  One of the major drawbacks, apart from the
> all-permeating horror that is Emacs, is that you can only have one
> Lisp/Scheme buffer running and have to start other Schemes in xterms (or
> ordinary shell buffers) if you need more (which I usually do).

??? Where did you get _this_ from? I'm currently running emacs with
SLIME and have several Lisp buffers open (to 3 different Lisp at the
same time). I don't know about quack.el capabilites but i don't see
where emacs should limit the number of buffers.

Ralf Mattes




Report this thread to moderator Post Follow-up to this message
Old Post
R. Mattes
05-19-05 01:57 PM


Sponsored Links




Last Thread Next Thread Next
Pages (3): [1] 2 3 »
Search this forum -> 
Post New Thread

Scheme archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:59 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.