Hi!
Logtalk 2.17.2 is now available for downloading from the Logtalk web site:
Logtalk is an open source object-oriented extension to the Prolog programming language. Integrating logic programming with object-oriented and event-driven programming, it is compatible with most Prolog compilers. It supports both prototypes and classes. In addition, it supports component-based programming through category-based composition.
This version improves documentation for first time users, includes a new programming example, corrects some bugs related to operator handling and local dynamic predicates, updates the compiler to allow source files containing only directives, and replaces the examples Prolog loader utility files by Logtalk files, thus simplifying example loading for new users.
From the release notes:
* Updated the Logtalk compiler to allow compilation of source files which contain only directives and no entity definition.
* Simplified loading of library and example entities by using Logtalk source files as loader files.
* Some improvements to the documentation, including the QUICK_START file and the User Manual for first-time users, and to the example descriptions.
* Corrected a bug in handling of local object operators that are also global operators.
* Corrected a bug where dynamic directives are not being generated for dynamic predicates that lack a scope directive or an initial set of clauses.
* Corrected a bug where local dynamic predicates would need a private scope directive in order to allow clauses of the predicate to be retracted.
* Simplified compilation of dynamic and discontiguous predicate directives.
* Added new "logic" example implementing a translator from logic propositions to conjunctive normal form.
* Corrected a problem with wrong end-on-lines on some files.
* Added a shell script for easy integration of Logtalk with CIAO Prolog.
The CVS tag for this release is "lgt2172".
Happy logtalking!
Paulo
----------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Informatics Office 4.3 Ext. 3257 University of Beira Interior Phone: +351 275319700 6201-001 Covilhã Fax: +351 275319891 Portugal
mailto:pmoura(a)di.ubi.pt http://www.di.ubi.pt/~pmoura http://www.logtalk.org -----------------------------------------------------------
============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
Hi everyone,
Is it possible to use editing facilities in the top level shell so that it acts more like a unix shell? I'm thinking of being able to use the up/down arrows to go through a history of queries and left/right for editing what you've typed without having to delete it.
Amoss ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
Amoss writes:
Is it possible to use editing facilities in the top level shell
if u are running the toplevel under emacs, then M-p (Meta-p, where meta is Alt key usually) or Ctrl-Up shows the previous option.
M-n or Ctrl-Down do the opposite.
so that it acts more like a unix shell? I'm thinking of being
if you are the toplevel under a shell... depends on so many things :(
PS: M-p means that you press Meta (alt) and then p
On Wed, 16 Jun 2004, David Trallero Mena wrote:
Amoss writes:
Is it possible to use editing facilities in the top level shell
if u are running the toplevel under emacs, then M-p (Meta-p, where meta is Alt key usually) or Ctrl-Up shows the previous option.
M-n or Ctrl-Down do the opposite.
I think that this is the functionality that I want, if by previous/next option you mean the queries that are entered at the prompt, but I'm not running under emacs. I'm just calling the top-level shell from a bash shell (using 'ciao'), and there don't seem to be any editing facilities apart from backspace. Is there some way of gaining this functionality (cursor movement, history, editing..) without using emacs?
Amoss ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
I think that this is the functionality that I want, if by previous/next option you mean the queries that are entered at the prompt, but I'm not running under emacs. I'm just calling the top-level shell from a bash shell (using 'ciao'), and there don't seem to be any editing facilities apart from backspace. Is there some way of gaining this functionality (cursor movement, history, editing..) without using emacs?
Ciao does not provide that functionality (not at the moment, at least). Not that it cannot be done, but that would imply putting in the toplevel pieces which really do not belong to a compiler/interpreter, and which are probably better handled by an external tool which just hands strings typed by the user to the toplevel's standard input, and presents the interpreter output to the user in a reasonable form.
Quite often, a "reasonable form" means just showing the user whatever the interpreter generates. Sometimes there are presentations better than this one: for example, if you use the Emacs interface for debugging (and if everything works as it should :-), you'll see that the file being debugged pops up in an Emacs buffer and the statements being executed are highlighted. [Note that I am not trying to get credit for the debugger, as it is not my work; I am just describing it].
The bottom line is that while the interpreter/compiler should do its job, there are good reasons to think that its job is just to read and write, and not to make editing easier, because there are other tools whose strong points are precisely in making edition easy. Moreover, trying to interpret special character codes in the toplevel might interfere with these tools or with whatever environment the toplevel is running inside.
This being said, Emacs was chosen to implement a development environment because most of the Ciao developers use Emacs extensively, so it makes sense to build the first environment around the tools we use. Why we think Emacs is a wonderful tool to work with is another question, of course, and a matter of debate (orthogonal to this message).
Having started with (and maintaining the) Emacs environment does not mean at all that we do not want other environments to be developed: after all, the Ciao sources are there, and the behavior of the compiler and toplevel is relatively simple and has remained largely untouched for the last few years. And it can of course be adapted (within the limits of adaptability) to the needs of other environment tools. We are open to collaboration. [Note again that I do not pretend to get credit for the development of the programming environment!]
In any case, we wholeheartedly advice using the Emacs environment, because there are many things which are made simpler by it, such as compiling, loading files into the toplevel, locating errors, debugging, generating documentation, a special buffer to interact with the interpreter, etc. It is, of course, not compulsory. Also, I suppose that there should be graphical tools (other than emacs, that is) which can spawn a subprocess and connect with its standard I/O while keeping track of the lines the user types in and, at the same time, accepting some edition commands to feed the subprocess with previous strings, giving the user the possibility to edit them, etc., without the internal subprocess being aware of this. You get, then, a potentially much more poweful combination with less interaction among the pieces. This is, in many aspects, what the Emacs environment for Ciao Prolog (and for other interpreters) does.
If, for any reason, you prefer not to use the Emacs environment an intermediate solution is just start up an Emacs, type "M-x shell", and then you'll have a shell where the history is saved and can be seen as text. You can access the previously typed strings as David said --- and it does not matter whether these are shell commands, Haskell expressions or Prolog goals. Specialized environments for different languages try to make the range of edition commands available as useful as possible for these languages.
In any case, we wholeheartedly advice using the Emacs environment,because there are many things which are made simpler by it, such as compiling, loading files into the toplevel, locating errors, debugging, generating documentation, a special buffer to interact with the interpreter, etc. It is, of course, not compulsory. Also, I suppose that there should be graphical tools (other than emacs, that is) which can spawn a subprocess and connect with its standard I/O while keeping track of the lines the user types in and, at the same time, accepting some edition commands to feed the subprocess with previous strings, giving the user the possibility to edit them, etc., without the internal subprocess being aware of this. You get, then, a potentially much more poweful combination with less interaction among the pieces. This is, in many aspects, what the Emacs environment for Ciao Prolog (and for other interpreters) does.
If, for any reason, you prefer not to use the Emacs environment anintermediate solution is just start up an Emacs, type "M-x shell", and then you'll have a shell where the history is saved and can be seen as text. You can access the previously typed strings as David said --- and it does not matter whether these are shell commands, Haskell expressions or Prolog goals. Specialized environments for different languages try to make the range of edition commands available as useful as possible for these languages.
I can understand that you guys have developed quite a tightly integrated tool, and from I've seen so far playing with it, it does seem to work really well. There are two separate paradigms though, one of a large intergrated tool in which everything is polished to work together, and the other of a minimalist approach made of lots of small tools. It's an old argument and the reason is that both approaches work, which works best is quite an individual thing. I want to use the Ciao toolset, but not within an integrated editor as I already have a tool that edits well that I'm proficent at.
Using the "M-x ciao" approach seems to work really well and does exactly what I want from the system. It means that I get a raw top-level shell but with editing and history. I'll probably start using the integrated debugger as well as it looks pretty and seems to be the easiest way to use it. Using the combination of emacs+ciao as just a ciao shell rather than an editor seems to work well but I still have a few basic questions:
Using the shell outside of emacs I hit ^c and then type 'a' to abort a call that doesn't terminate. How do I do this inside emacs as it absorbs the ^c and waits for something else? I tried the signal menu but couldn't abort the call.
When typing in emacs it matches the brackets that you type by moving the cursor. Is there a way to switch this off?
At the moment I start a shell by typing emacs, then hitting M-x ciao. Is there a way to tell emacs to do this on the command line so that I can create an alias that starts up emacs with a ciao shell running?
Thanks, Amoss ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
Here are some suggestions. The default graphical environment is started up as follows:
emacs -f ciao-startup
Or, if you only want the ciao shell:
emacs -f ciao
If you have no .emacs:
emacs -q -l /home/clip/lib/ciao/ciao-1.9/DOTemacs.el -f ciao-startup
emacs -q -l /home/clip/lib/ciao/ciao-1.9/DOTemacs.el -f ciao
You can get an icon to do thin in, e.g., adding a file:
~/.gnome-desktop/The Ciao Environment.desktop
containing (paths may have to change of course):
[Desktop Entry] Name=The Ciao Prolog Environment Comment=Starting the Ciao Prolog Environment Name[en_US.ISO8859-1]=Ciao Prolog Environment Comment[en_US.ISO8859-1]=Starting the Ciao Prolog Environment Exec=/usr/bin/emacs -q -l /home/clip/lib/ciao/ciao-1.9/DOTemacs.el -f ciao-startup Icon=/home/clip/Systems/ciao/emacs-mode/icons/ciao.xpm Terminal=false MultipleArgs=false Type=Application
--Manuel
Using the shell outside of emacs I hit ^c and then type 'a' to abort a call that doesn't terminate. How do I do this inside emacs as it absorbs the ^c and waits for something else? I tried the signal menu but couldn't abort the call.
You have to escape these things with another ^C, i.e., ^C is ^C^C, ^D is ^C^D, etc.
When typing in emacs it matches the brackets that you type by moving the cursor. Is there a way to switch this off?
Note that the cursor does not really move, it just points out the matching parenthesis. It is in the Options menu.
--Manuel
Amoss writes:
I think that this is the functionality that I want, if by previous/next option you mean the queries that are entered at the prompt
Exactly that is what I mean.
apart from backspace. Is there some way of gaining this functionality (cursor movement, history, editing..) without using emacs?
No as far as I know. Cursors are interpreted as escape commands, emacs read and treat them. The same as bash or csh shell... but "toplevel" does not.
apart from backspace. Is there some way of gaining this functionality (cursor movement, history, editing..) without using emacs?
the problem is that (in our modest opinion) it does not really make sense to put all this within the Ciao shell, when it is already done by the graphical environment (which, in our case, is the Ciao emacs mode). Also, the environment provides so many other things (coloring, menus, on-line help, etc.) that we just have to strongly recommend that you usue it: it really makes a huge difference in the usability. In return for you trying it we offer to answer all your emacs questions... :-) --Man
Couldn't you get a lot of the functionality with very little work by using the GNU readline facility?
Peace - John
--On Wednesday, June 16, 2004 7:14 PM +0200 Manuel Hermenegildo <herme(a)fi.upm.es> wrote:
apart from backspace. Is there some way of gaining this functionality (cursor movement, history, editing..) without using emacs?
the problem is that (in our modest opinion) it does not really make sense to put all this within the Ciao shell, when it is already done by the graphical environment (which, in our case, is the Ciao emacs mode). Also, the environment provides so many other things (coloring, menus, on-line help, etc.) that we just have to strongly recommend that you usue it: it really makes a huge difference in the usability. In return for you trying it we offer to answer all your emacs questions... :-) --Man
--
---- herme(a)fi.upm.es | Manuel Hermenegildo +34-91-336-7435 (Work) | Facultad de Informatica +34-91-352-4819 or 336-7412 (FAX) | Universidad Politecnica de Madrid http://www.clip.dia.fi.upm.es/~herme | 28660-Boadilla del Monte, MADRID SPAIN
========================================================================= ===== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list
---- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/
============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
Couldn't you get a lot of the functionality with very little work by using the GNU readline facility?
Yes, you are right. However that would make Ciao dependant to that library... Surely there are interesting features that could be implemented in that way (for example, tab-completion, etc.), however the current design of Ciao relies on Emacs to implement most part of the user-interface. ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------
And here is a small primer (from the Ciao manual):
An introduction to the Ciao emacs environment (Un*x)
==================================================== >
While it is easy to use Ciao with any editor of your choice, using it within the `emacs' editor/program development system is highly recommended: Ciao includes an `emacs' _mode_ which provides a very complete _application development environment_ which greatly simplifies many program development tasks. See *Note Using Ciao inside GNU emacs:: for details on the capabilities of `ciao'/ `emacs' combination.
If the (freely available) `emacs' editor/environment is not installed in your system, we highly recommend that you also install it at this point (there are instructions for where to find `emacs' and how to install it in the Ciao installation instructions). After having done this you can try for example the following things:
A few basic things:
Typing <^H> <i> (or in the menus `Help->Manuals->Browse Manuals with Info') should open a list of manuals in info format in which the Ciao manual(s) should appear.
When opening a Prolog file, i.e., a file with `.pl' or `.pls' ending, using <^X><^F>`filename' (or using the menus) the code should appear highlighted according to syntax (e.g., comments in red), and `Ciao/Prolog' menus should appear in the menu bar on top of the `emacs' window.
Loading the file using the `Ciao/Prolog' menu (or typing
<^C> <l>) should start in another emacs buffer the Ciao toplevel shelland load the file. You should now be able to switch the the toplevel shell (with the mouse or typing <^X> <o>) and make queries from within `emacs'.
*Note:* when using `emacs' it is _very convenient_ to swap the locations of the (normally not very useful) <Caps Lock> key and the (very useful in `emacs') <Ctrl> key on the keyboard. How to do this is explained in the `emacs' frequently asked questions FAQs (see the `emacs' download instructions for their location).
(if these things do not work the system or emacs may not be installed properly).
You can go to the location of most of the errors that may be reported during compilation by typing <^C> <`>.
You can also, e.g., create executables from the `Ciao/Prolog' menu, as well as compile individual files, or generate active modules.
Loading a file for source-level debugging using the `Ciao/Prolog' menu (or typing <^C> <d>) and then issuing a query should start the source-level debugger and move a marker on the code in a window while execution is stepped through in the window running the Ciao top level.
You can add the lines needed in Un*x for turning any file defining `main/1' into a script from the Ciao/Prolog menu or by typing <^C> <I> <S>.
You can also work with the preprocessor and auto-documenter directly from emacs: see their manuals or browse through the corresponding menus that appear when editing `.pl' files.
We encourage you once more to read *Note Using Ciao inside GNU emacs:: to discover the many other functionalities of this environment.
--- Amoss <moss(a)cs.bris.ac.uk> wrote:
I'm just calling the top-level shell from a bash shell (using 'ciao'), and there don't seem to be any editing facilities apart from backspace. Is there some way of gaining this functionality (cursor movement, history, editing..) without using emacs?
Usually you need to have the REPL compiled with Readline support to get this. Otherwise the Prolog listener doesn't know what to do with the control characters sent by your keyboard.
-Brent ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------