[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

A short review of ed, from Informatimago

Rosangela Mesil

6/10/2015 4:50:00 AM

Informatimago distributes an ed clone that is worthy of review and feedback.. After all, to spread the news about good products is a service to the public, and to acclaim those who ply their trade well is a duty of justice. Then I want to extend my appreciation to the author of ed/Lisp for taking the time and effort necessary to provide such a nice piece of software. However, I don't know anything about Lisp. Therefore I hope that a more knowledgeable professional make another review with better suggestions. Feci quod potui, faciant meliora potentes.

As a lawyer, I often connect myself to the cloud, and prepare motions and pleadings through text processing tools written in lisp, elisp, and prolog. When I am in my office, in front of my MacIntosh, using my Dvorak Kinesis keyboard or my stenotype machine, I use emacs. Then I insert the bar association smart card into the reader, and employ the opensc library to file the result to the tribunals. For the casual bystander, this world of electronic pleading seems glamorous and charming. But I often find myself in court rooms where the Internet bandwidth is less than one could have hoped for. Then emacs fails miserably. In these occasions, I really appreciate gnu ed.

Of course, I don't know much about lisp, mercury and yap prolog. For me, lisp, rasp and yap prolog work thus: One writes an org-mod document with the details of the pleading, run emacs --script expand.el on it, and then ccl --load petitio.lisp. The result is a beautiful and small pdf document ready for the judge's appreciation. So, I see Lisp the same way as I see my stenotype keyboard: A way of producing documents in the shortest period of time. Some time, I use it to calculate my fees:

? #i(3*4-5)

==== ======== ========
Now, the feedback. What about shorter names for the prefixes? Whenever I need to install the package in a new machine, I must hire an expert to shorten the name of the prefix. The guy charges 100 bucks to write the lines below.

? (defun xed(x) (COM.INFORMATIMAGO.COMMON-LISP.ED.ED:ed x))
? (save-application "ccl.ed" :prepend-kernel t)

Did you see the episode "And I am Joyce Kinney" of Family Guy? As you probably know, Family Guy is co-produced by Cherry Chevapravatdumrong, who has a very long name. Therefore, she often shortens it to Cherry Cheva.

I was informed that your intention was to write a perfect clone of a very old program, a program from a time when input was done through teletypes, not through Dvorak Kinesis keyboards or stenotype touchscreens. However, you could write a different version to ease the life of lawyers. I know, I know, everybody hates lawyers. Why don't snakes bite attorneys? Professional courtesy. How can you tell when a lawyer is lying? His lips move. What do female lawyers use for birth control? Their personalities. Yes, I am a lawyer, but I am asking for so little: When I print the program with n or p, I want a cursor on the line (a vertical bar | will do), and commands to move the cursor forward and backward, to insert text at the cursor, and to delete text behind the cursor. Thus, I would not need regular expressions all the time. Example:

: ,n
1 aut viam inveniam vel faciam.
2 perfer et obdura; dolor hic tibi proderit olim.
3 dimidium facti qui coepit habet.
: 1
aut viam inveniam vel faciam.|
: v # go to previous word
aut viam inveniam vel | faciam.
: 3 g
aut viam inveniam | faciam.
: b
aut
.
p
aut viam inveniam aut| faciam.


The other thing I believe that you could easily add to ed is a stenotype keyboard. A stenotype keybord would be very useful on cell phones. You could implement it in mocl (yes, I know about mocl). Of course, you don't need to add the chords, since these varies from language to language. All you need to do is to write the functionality, and people will feed whatever dictionary they prefer.
2 Answers

Pascal J. Bourguignon

6/10/2015 5:08:00 AM

0

Rosangela Mesil <rosangelamesil@gmail.com> writes:

> Informatimago distributes an ed clone that is worthy of review and
> feedback. After all, to spread the news about good products is a
> service to the public, and to acclaim those who ply their trade well
> is a duty of justice. Then I want to extend my appreciation to the
> author of ed/Lisp for taking the time and effort necessary to provide
> such a nice piece of software.

Notice that there remains a few bugs, and some features are not
implemented yet.

Namely, regexp search and replace is not implemented
At the time (it was before cl-ppcre was created), I started implementing
a regexp package, got side tracked into the variants of regexp syntax
(emacs regexp, posix regexp, etc); my regexp packages are not finished,
and therefore are not integrated into ed.

Nowadays, one could integrate easily enough cl-ppcre with ed to support
regexp commands.


Patches would be gladly accepted.

--
__Pascal Bourguignon__ http://www.informat...
â??The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.� -- Carl Bass CEO Autodesk

Pascal J. Bourguignon

6/10/2015 6:15:00 AM

0

Rosangela Mesil <rosangelamesil@gmail.com> writes:

> Informatimago distributes an ed clone that is worthy of review and
> feedback.
> [â?¦]
> Now, the feedback. What about shorter names for the prefixes? Whenever
> I need to install the package in a new machine, I must hire an expert
> to shorten the name of the prefix. The guy charges 100 bucks to write
> the lines below.
>
> ? (defun xed(x) (COM.INFORMATIMAGO.COMMON-LISP.ED.ED:ed x))
> ? (save-application "ccl.ed" :prepend-kernel t)

or:

(shadow 'ed)
(use-package :com.informatimago.common-lisp.ed.ed)
(save-application "ccl.ed" :prepend-kernel t)

and then use:

(ed)



But basically, there are two reasons why there is no script to generate
a stand-alone "ed" exectuable from this package, and no shorter name:

1- it's not production ready;

2- it was envisionned that it would be used more inside the Common Lisp
environment than as a stand-alone program, since GNU ed(1) already
exists.




> But I often find myself in court rooms where the Internet
> bandwidth is less than one could have hoped for. Then emacs fails
> miserably.

How does GNU emacs fail then?
What documents do you edit?
Where do they come from?
Where do you save or send them to?


It would probably be better to solve the problem with GNU emacs.


You would edit local files better with emacs
(http://www.emacsfor... on MacOSX), and even remote files could
be edited easily with tramp (tramp allows emacs to download remote files
for local editing, and upload them back when saving).

Even if you edited remotely (with emacs and the file on the remote
host), using emacs in a terminal should be doable on low bandwidth
connections. I've even used emacs on X thru low bandwidth, once it is
launched, emacs displays only text so it is quite usable.





Notice that I have in preparation a simple emacs written in CL
https://gitlab.com/com-informatimago/com-informatimago/tree/mas...
(I'm in the process of introducing a portability layer to be able to
work both on clisp screen and on cl-charm).
But in any case the purpose here is to have a small and simple program
that newbies may easily study and modify, rather than a full fleshed
emacs. It's not ready for consumption yet.



> When I print the program with n or p, I want a cursor on
> the line (a vertical bar | will do), and commands to move the cursor
> forward and backward, to insert text at the cursor, and to delete text
> behind the cursor. Thus, I would not need regular expressions all the
> time. Example:
>
> : ,n
> 1 aut viam inveniam vel faciam.
> 2 perfer et obdura; dolor hic tibi proderit olim.
> 3 dimidium facti qui coepit habet.
> : 1
> aut viam inveniam vel faciam.|
> : v # go to previous word
> aut viam inveniam vel | faciam.
> : 3 g
> aut viam inveniam | faciam.
> : b
> aut
> .
> p
> aut viam inveniam aut| faciam.

Yes, such a set of commands could be added (there remains enough unused
letters to add such commands).

But again, my advice would be to:

1- try to solve the problem you have with emacs (ask on
news:gnu.emacs.help),

2- consider patching GNU ed itself (having it patched) to add the
commands you find useful.

3- or indeed, I could implement them, but I wouldn't feel good letting
you use com.informatimago.common-lisp.ed as it is currently in a
professional setting, given its "untested" status, and the
possibilities of you encountering bugs, possibly with data loss. For
this, more work on it would be needed, and this would have to come
with a cost since it would take time.


> The other thing I believe that you could easily add to ed is a
> stenotype keyboard. A stenotype keybord would be very useful on cell
> phones. You could implement it in mocl (yes, I know about mocl). Of
> course, you don't need to add the chords, since these varies from
> language to language. All you need to do is to write the
> functionality, and people will feed whatever dictionary they prefer.

Isn't this more a general hardware and input method problem, rather than
a specific program problem?

I'm not sure how you could input stenotype chords on a normal laptop
keyboard. One could use a n-key rollover keyboard (and remember that
thru USB, n-key rollover keyboards are actually limited to 6-key
rollover, so you could use them only connected thru PS2 to a PC
desktop); laptop keyboards are often more limited.

In anycase, as indicated on
http://openstenopr...
you could try to install Plover, and see how it works on your hardware.
http://stenoknight.com/wiki/Getting_Started#Install...


--
__Pascal Bourguignon__ http://www.informat...
â??The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.� -- Carl Bass CEO Autodesk