caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] OCaml as fancy calculator...
@ 2001-08-05  9:16 Oliver Bandel
  2001-08-05 11:06 ` Pixel
  2001-08-07 14:32 ` John Max Skaller
  0 siblings, 2 replies; 10+ messages in thread
From: Oliver Bandel @ 2001-08-05  9:16 UTC (permalink / raw)
  To: caml-list

Hello,

in the examples of the introductional texts to OCaml
is mentioned, that OCaml may be used as a fancy
calculator.
Ok, if I take this idea, I want to have some mathematical
libraries, like histograms (frequencies) and the like.

If I write some often-needed mathematical routines,
so that it can be used with file-based OCaml-programs
for compilation, how can I use such files (or the compiled
byte-code or binaries) for interactive sessions with
ocaml?

Is this the first step to use the module system?
Or can I start with things like "include"-statements
in other calculator-like programs? (Including
source-files like an #include in C or load-commands
of some programs.)

I think about writing some mathematical routines
and maybe some output-routines to postscript
(Or maybe I can use cdk for this?).

Maybe this can acchieve things like gnuplot does,
but in a functional way.

So I'm thinking about implementing some simple
routines for loading data-files, doing mathematical
operations and writing the results as ASCII-output and
maybe as postscript-output (or psTricks-Output for including
the reults in LaTeX-documents).


I think as a beginner of FPLs and OCaml, it's too much effort
to write a complete application like a functional-gnuplot.

I want to use this tool for solving some common problems of the day
and I want to learn OCaml (and FP in general) with it.
So, it's ok, if it is only a small tool. But I want to have the
right design decisions for using it as a tool, but one, which is
expandable in future time, when it - maybe - can become a
complete application.



* Any hints, how to plan/design such a project, which
  tools I can use and so on...?!
* How can I use it in in interactive mode?

* other things to think about?


TIA,
  Oliver

-- 
    Obviously, because programming is a creative activity there is not
    going to be a set of rules which will always lead us mechanically
    to a solution to a problem.
            (Simon Thompson: Haskell - The Craft of Functional Programming)

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] OCaml as fancy calculator...
  2001-08-05  9:16 [Caml-list] OCaml as fancy calculator Oliver Bandel
@ 2001-08-05 11:06 ` Pixel
  2001-08-05 15:15   ` Oliver Bandel
  2001-08-07 14:32 ` John Max Skaller
  1 sibling, 1 reply; 10+ messages in thread
From: Pixel @ 2001-08-05 11:06 UTC (permalink / raw)
  To: Oliver Bandel; +Cc: caml-list

Oliver Bandel <oliver@first.in-berlin.de> writes:

> So I'm thinking about implementing some simple
> routines for loading data-files, doing mathematical
> operations and writing the results as ASCII-output and
> maybe as postscript-output (or psTricks-Output for including
> the reults in LaTeX-documents).

have a look at mathplot:
  http://www.chez.com/prigaux/mathplot.html
  http://www.chez.com/prigaux/mathplot_screenshots/

It's written in OCaml using the Tk toolkit for the GUI frontend
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] OCaml as fancy calculator...
  2001-08-05 11:06 ` Pixel
@ 2001-08-05 15:15   ` Oliver Bandel
  2001-08-05 19:36     ` Pixel
  0 siblings, 1 reply; 10+ messages in thread
From: Oliver Bandel @ 2001-08-05 15:15 UTC (permalink / raw)
  To: Pixel; +Cc: caml-list

Hello,

On Sun, 5 Aug 2001, Pixel wrote:

> Oliver Bandel <oliver@first.in-berlin.de> writes:
> 
> > So I'm thinking about implementing some simple
> > routines for loading data-files, doing mathematical
> > operations and writing the results as ASCII-output and
> > maybe as postscript-output (or psTricks-Output for including
> > the reults in LaTeX-documents).
> 
> have a look at mathplot:
>   http://www.chez.com/prigaux/mathplot.html
>   http://www.chez.com/prigaux/mathplot_screenshots/
> 
> It's written in OCaml using the Tk toolkit for the GUI frontend
> 

I tried mathplot some weeks ago, but can't compile it.
I think it is written in Caml Light, or it was a very old
version of COaml... I don't remember. But it was not
possible to let it run.

The other point is: If I use ready written software,
I can not learn programming OCaml.....

Ciao,
  Oliver

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] OCaml as fancy calculator...
  2001-08-05 15:15   ` Oliver Bandel
@ 2001-08-05 19:36     ` Pixel
  0 siblings, 0 replies; 10+ messages in thread
From: Pixel @ 2001-08-05 19:36 UTC (permalink / raw)
  To: Oliver Bandel; +Cc: caml-list

Oliver Bandel <oliver@first.in-berlin.de> writes:

> I tried mathplot some weeks ago, but can't compile it.
> I think it is written in Caml Light, or it was a very old
> version of COaml... I don't remember. But it was not
> possible to let it run.

? the initial version was written for OCaml 2.01

the current version compile with OCaml 3.0x

> 
> The other point is: If I use ready written software,
> I can not learn programming OCaml.....

good point, happy hacking :)
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] OCaml as fancy calculator...
  2001-08-05  9:16 [Caml-list] OCaml as fancy calculator Oliver Bandel
  2001-08-05 11:06 ` Pixel
@ 2001-08-07 14:32 ` John Max Skaller
       [not found]   ` <20010807171614.B1646@hars>
  1 sibling, 1 reply; 10+ messages in thread
From: John Max Skaller @ 2001-08-07 14:32 UTC (permalink / raw)
  To: Oliver Bandel; +Cc: caml-list

Oliver Bandel wrote:

> If I write some often-needed mathematical routines,
> so that it can be used with file-based OCaml-programs
> for compilation, how can I use such files (or the compiled
> byte-code or binaries) for interactive sessions with
> ocaml?
> 
> Is this the first step to use the module system?

	Yes. First, create a file, say

	my_routines.ml

and then compile it to bytecode:

	ocamlc my_routines.ml

Note that you have just created a module

	My_routines

Note the Capital letter onon the module name and the
lower case letter on the filename.

Now you can use it in the top level, in one or two steps.
First, you must say

	#load "my_routines.cmo"

Now you can say:

	My_routines.sin 1.2;;

and you'll get your routine 'sin' from module My_routines
called: thats the 'sin' in the file 'my_routines.ml'.
You can avoid typing the prefix 'My_routines' by saying

	open My_routines;;

then

	sin 1.2;;

but you should note that this will hide any other routine 'sin'
that's hanging around.

If you want to script a series of calculations in a file

	my_calcs.ml

you can say

	#use "my_calcs.ml"

Note that this is like a C #include: it compiles and executes as it
goes.
Whereas the #load is loading _already_ compiled code.

It's a good idea to run the top level 'ocaml' with 

	ledit ocaml

if you like keyboard editing. You'll need to download and build ledit
first. [Perhaps this will get built into the top level one day :-]

-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au 
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
New generation programming language Felix  http://felix.sourceforge.net
Literate Programming tool Interscript     
http://Interscript.sourceforge.net
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Caml-list] Re: ledit (was: OCaml as fancy calculator...)
       [not found]   ` <20010807171614.B1646@hars>
@ 2001-08-07 17:34     ` Daniel de Rauglaudre
  2001-08-09  7:21       ` Florian Hars
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel de Rauglaudre @ 2001-08-07 17:34 UTC (permalink / raw)
  To: Florian Hars; +Cc: caml-list

Hi,

On Tue, Aug 07, 2001 at 05:16:14PM +0200, Florian Hars wrote:

> ~/src/ledit-1.10$ make
> camlp4r ./pa_local.cmo -warn_seq cursor.ml -o cursor.ppo
> -warn_seq: unknown or misused option
> Use option -help for usage

You need OCaml and Camlp4 versions 3.02 to compile the latest versions
of ledit.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Re: ledit (was: OCaml as fancy calculator...)
  2001-08-07 17:34     ` [Caml-list] Re: ledit (was: OCaml as fancy calculator...) Daniel de Rauglaudre
@ 2001-08-09  7:21       ` Florian Hars
  2001-08-09  7:30         ` Laurent Chéno
                           ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Florian Hars @ 2001-08-09  7:21 UTC (permalink / raw)
  To: Daniel de Rauglaudre; +Cc: Florian Hars, caml-list

On Tue, Aug 07, 2001 at 07:34:18PM +0200, Daniel de Rauglaudre wrote:
> You need OCaml and Camlp4 versions 3.02 to compile the latest versions
> of ledit.

This is bad, since it means that ledit will not be usable on Debian systems
for at least the next two years. (Apart from the license problem that
prohibits its inclusion anyway).

Yours, Florian.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Re: ledit (was: OCaml as fancy calculator...)
  2001-08-09  7:21       ` Florian Hars
@ 2001-08-09  7:30         ` Laurent Chéno
  2001-08-09  8:02         ` Ari Heitner
  2001-08-09  8:37         ` Sven
  2 siblings, 0 replies; 10+ messages in thread
From: Laurent Chéno @ 2001-08-09  7:30 UTC (permalink / raw)
  To: Florian Hars; +Cc: Caml-list

(please excuse my poor english)

> On Tue, Aug 07, 2001 at 07:34:18PM +0200, Daniel de Rauglaudre wrote:
>> You need OCaml and Camlp4 versions 3.02 to compile the latest versions
>> of ledit.
>

I used OCaml 3.01 to compile ledit before the birth of OCaml 3.02. And I 
use ledit with the new ocaml, of course...

Yours,
Laurent
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Re: ledit (was: OCaml as fancy calculator...)
  2001-08-09  7:21       ` Florian Hars
  2001-08-09  7:30         ` Laurent Chéno
@ 2001-08-09  8:02         ` Ari Heitner
  2001-08-09  8:37         ` Sven
  2 siblings, 0 replies; 10+ messages in thread
From: Ari Heitner @ 2001-08-09  8:02 UTC (permalink / raw)
  To: Florian Hars; +Cc: Daniel de Rauglaudre, Florian Hars, caml-list

On Thu, Aug 09, 2001 at 09:21:41AM +0200, Florian Hars wrote:
> On Tue, Aug 07, 2001 at 07:34:18PM +0200, Daniel de Rauglaudre wrote:
> > You need OCaml and Camlp4 versions 3.02 to compile the latest versions
> > of ledit.
> 
> This is bad, since it means that ledit will not be usable on Debian systems
> for at least the next two years. (Apart from the license problem that
> prohibits its inclusion anyway).
> 
how do you figure?

[from /debian/dists/sid/main/binary-i386/Packages.gz]

Package: camlp4
Version: 3.02-1

Package: ocaml
Version: 3.02-1

Claiming things are broken because you are unwilling to run up-to-date
versions of dependencies is pretty anti-progress, and a lousy excuse or
reason for anything, imho.


cheers,

Ari

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Caml-list] Re: ledit (was: OCaml as fancy calculator...)
  2001-08-09  7:21       ` Florian Hars
  2001-08-09  7:30         ` Laurent Chéno
  2001-08-09  8:02         ` Ari Heitner
@ 2001-08-09  8:37         ` Sven
  2 siblings, 0 replies; 10+ messages in thread
From: Sven @ 2001-08-09  8:37 UTC (permalink / raw)
  To: Florian Hars; +Cc: Daniel de Rauglaudre, Florian Hars, caml-list

On Thu, Aug 09, 2001 at 09:21:41AM +0200, Florian Hars wrote:
> On Tue, Aug 07, 2001 at 07:34:18PM +0200, Daniel de Rauglaudre wrote:
> > You need OCaml and Camlp4 versions 3.02 to compile the latest versions
> > of ledit.
> 
> This is bad, since it means that ledit will not be usable on Debian systems
> for at least the next two years. (Apart from the license problem that
> prohibits its inclusion anyway).

No, that is not true, i have uploaded a ocaml 3.02 to unstable, and i hope the 
camlp4 maintainer will do so also soon (if not, just submit a bug report against
it, and if that don't help, i will do a NMU of it).

lftp ftp.fr.debian.org:/debian/pool/main/o/ocaml> ls -l ocaml_3.02*
-rw-rw-r--   1 mysql    102          9745 Aug  3 17:33 ocaml_3.02-1.diff.gz
-rw-rw-r--   1 mysql    102           684 Aug  3 17:33 ocaml_3.02-1.dsc
-rw-rw-r--   1 mysql    102       4311250 Aug  4 03:15 ocaml_3.02-1_alpha.deb
-rw-rw-r--   1 mysql    102       2123598 Aug  4 02:06 ocaml_3.02-1_hppa.deb
-rw-rw-r--   1 mysql    102       3776464 Aug  3 17:33 ocaml_3.02-1_i386.deb
-rw-rw-r--   1 mysql    102       1614709 Aug  3 17:33 ocaml_3.02.orig.tar.gz

I have also planned to package ledit, but a disk crash came in the way, and was
rather busy since then. I don't think the licence problem is unsolvable, if there
is any (don't remember, will check again).

That said, debian has not yet freezed the boot floppies nor the policy, and
until the policy is not finalized, there cannot be a package freeze. Next will come,
if i am right, the base and essential package freeze, and planned for begin of
september the package freeze. But since the boot floppy freeze had some delay, the
package freeze will more probably be around october, in anyway this is far enough
time for an update to all the ocaml stuff.

Friendly,

Sven Luther
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-08-09  8:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-05  9:16 [Caml-list] OCaml as fancy calculator Oliver Bandel
2001-08-05 11:06 ` Pixel
2001-08-05 15:15   ` Oliver Bandel
2001-08-05 19:36     ` Pixel
2001-08-07 14:32 ` John Max Skaller
     [not found]   ` <20010807171614.B1646@hars>
2001-08-07 17:34     ` [Caml-list] Re: ledit (was: OCaml as fancy calculator...) Daniel de Rauglaudre
2001-08-09  7:21       ` Florian Hars
2001-08-09  7:30         ` Laurent Chéno
2001-08-09  8:02         ` Ari Heitner
2001-08-09  8:37         ` Sven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).