Re: small files in GProlog

Nicolas Pelletier <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <[email protected]>
Hello,

On Mon, May 25, 2009 at 5:07 PM, Robert SETIF <[email protected]> wrote:
> I am a new user of GProlog and I cannot write a correct file myself in spite
> of the  Help (accompanying the Software ), Help  that I find very abstract,
> more convenient for developpers than for beginner users.

This is a very general statement that is not going to help improving
what you see as a flaw. Try to point specifically to what needs to be
improved, and say how you would like it improved, for example by
submitting your explanation or a pattern for it. Keep in mind, though,
that the manual documents the GNU Prolog compiler, not the language
Prolog itself.

> That is why I need very small programs which  allow me to experiment them,
> and so to try modifying them for seing the results.
>
> Where finding such files?

Did you google ? Anyway, here is a very simple example to help you get started:

nicolas@tamago:~/dev/prolog$ cat > example.pl <<EOF
> :- initialization( go ).
>
> go :-
>     write( 'Hello, world !' ),
>     nl,
>     halt.
> EOF
nicolas@tamago:~/dev/prolog$ gplc --no-top-level --min-size --output
example example.pl
nicolas@tamago:~/dev/prolog$ ./example
Hello, world !
nicolas@tamago:~/dev/prolog$ ls -l example*
-rwxr-xr-x 1 nicolas nicolas 182576 2009-05-26 14:08 example
-rw-r--r-- 1 nicolas nicolas     81 2009-05-26 14:08 example.pl

Hope this helps,

-- 
Nicolas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.