* [Caml-list] Toplevel question ...
@ 2002-02-28 15:49 Andrzej M. Ostruszka
2002-03-01 9:36 ` Tomasz Zielonka
2002-03-06 10:24 ` [Caml-list] " Xavier Leroy
0 siblings, 2 replies; 8+ messages in thread
From: Andrzej M. Ostruszka @ 2002-02-28 15:49 UTC (permalink / raw)
To: Caml List
Hi,
Is there some alias in toplevel for the result of last evaluation so one
could use it instead of retyping (there's no history completion :() and
binding to some name?
I never thought I'll use OCaml for what I'm doing (theoretical physics -
no data analysis) but right now I'm doing some symbolic dynamics for
Markov chains and it is much more comfortable to do it in OCaml then in
Matlab (cause of 'a list :)).
Best regards
--
____ _ ___
/ | \_/ |/ _ \ Andrzej Marek Ostruszka
/ _ | | (_) | Instytut Fizyki, Uniwersytet Jagiellonski (Cracow)
/_/ L|_|V|_|\___/ (PGP <-- finger ostruszk@order.if.uj.edu.pl)
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] Toplevel question ...
2002-02-28 15:49 [Caml-list] Toplevel question Andrzej M. Ostruszka
@ 2002-03-01 9:36 ` Tomasz Zielonka
2002-03-02 10:25 ` [Caml-list] " Andrzej M. Ostruszka
2002-03-06 10:24 ` [Caml-list] " Xavier Leroy
1 sibling, 1 reply; 8+ messages in thread
From: Tomasz Zielonka @ 2002-03-01 9:36 UTC (permalink / raw)
To: Caml List
On Thu, Feb 28, 2002 at 04:49:22PM +0100, Andrzej M. Ostruszka wrote:
> Hi,
>
> Is there some alias in toplevel for the result of last evaluation so one
> could use it instead of retyping (there's no history completion :() and
> binding to some name?
Lack of history can be easily solved - use ledit:
ftp://ftp.inria.fr/INRIA/Projects/cristal/Daniel.de_Rauglaudre/Tools/ledit.tar.gz
regards,
tom
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Caml-list] Re: Toplevel question ...
2002-03-01 9:36 ` Tomasz Zielonka
@ 2002-03-02 10:25 ` Andrzej M. Ostruszka
0 siblings, 0 replies; 8+ messages in thread
From: Andrzej M. Ostruszka @ 2002-03-02 10:25 UTC (permalink / raw)
To: Caml List
On Fri, Mar 01 (2002), Tomasz Zielonka wrote:
> > Is there some alias in toplevel for the result of last evaluation so one
> > could use it instead of retyping (there's no history completion :() and
> > binding to some name?
>
> Lack of history can be easily solved - use ledit:
I'll use this mail as an opportunity to thank to all who suggested me
ledit cause this somewhat improves situation but it is still not what I
wanted :) (I want to avoid recomputing of the result).
If there no solution for it then I'll force myself to think before
typing (which I belive is not that bad policy :)) and bind result if it
can cost much of the cputime.
Best regards
--
____ _ ___
/ | \_/ |/ _ \ Andrzej Marek Ostruszka
/ _ | | (_) | Instytut Fizyki, Uniwersytet Jagiellonski (Cracow)
/_/ L|_|V|_|\___/ (PGP <-- finger ostruszk@order.if.uj.edu.pl)
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] Toplevel question ...
2002-02-28 15:49 [Caml-list] Toplevel question Andrzej M. Ostruszka
2002-03-01 9:36 ` Tomasz Zielonka
@ 2002-03-06 10:24 ` Xavier Leroy
2002-03-06 10:41 ` Mattias Waldau
2002-03-06 17:33 ` shiv
1 sibling, 2 replies; 8+ messages in thread
From: Xavier Leroy @ 2002-03-06 10:24 UTC (permalink / raw)
To: Caml List; +Cc: zielony
> Is there some alias in toplevel for the result of last evaluation so one
> could use it instead of retyping (there's no history completion :() and
> binding to some name?
The original Caml V3.1 had such a facility -- all results of toplevel
evaluations were bound to the name "it". This was removed in Caml
Light because of the way Caml Light handles toplevel binding: all
bindings accumulate forever, preventing the GC from reclaiming the
memory space used. Early versions of Objective Caml had the same
problem as Caml Light, but this was fixed in version 3.01: only the
values of lexically visible toplevel definitions are kept.
So, technically, it would be feasible to resurrect the Caml V3.1
behavior: evaluating "expr ;;" at top-level binds the result value to
the name "it". Do others think that it would be useful?
- Xavier Leroy
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [Caml-list] Toplevel question ...
2002-03-06 10:24 ` [Caml-list] " Xavier Leroy
@ 2002-03-06 10:41 ` Mattias Waldau
2002-03-06 17:33 ` shiv
1 sibling, 0 replies; 8+ messages in thread
From: Mattias Waldau @ 2002-03-06 10:41 UTC (permalink / raw)
To: 'Xavier Leroy', 'Caml List'; +Cc: zielony
So it would be as if
expr ;;
whould have been written as
let it = expr ;;
in the top-level. Since I currently often write
let x = expr ;;
it would save me 9 keystrokes. I think it is a good idea.
(But I think that soon people would ask you to keep all the
lines, so that we would write it.(4) instead.)
/mattias
> -----Original Message-----
> From: owner-caml-list@pauillac.inria.fr
> [mailto:owner-caml-list@pauillac.inria.fr] On Behalf Of Xavier Leroy
> Sent: Wednesday, March 06, 2002 11:25 AM
> To: Caml List
> Cc: zielony@cs.net.pl
> Subject: Re: [Caml-list] Toplevel question ...
>
>
> > Is there some alias in toplevel for the result of last
> evaluation so
> > one could use it instead of retyping (there's no history completion
> > :() and binding to some name?
>
> The original Caml V3.1 had such a facility -- all results of
> toplevel evaluations were bound to the name "it". This was
> removed in Caml Light because of the way Caml Light handles
> toplevel binding: all bindings accumulate forever, preventing
> the GC from reclaiming the memory space used. Early versions
> of Objective Caml had the same problem as Caml Light, but
> this was fixed in version 3.01: only the values of lexically
> visible toplevel definitions are kept.
>
> So, technically, it would be feasible to resurrect the Caml V3.1
> behavior: evaluating "expr ;;" at top-level binds the result
> value to the name "it". Do others think that it would be useful?
>
> - Xavier Leroy
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives:
http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs
FAQ: http://caml.inria.fr/FAQ/ Beginner's list:
http://groups.yahoo.com/group/ocaml_beginners
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] Toplevel question ...
2002-03-06 10:24 ` [Caml-list] " Xavier Leroy
2002-03-06 10:41 ` Mattias Waldau
@ 2002-03-06 17:33 ` shiv
1 sibling, 0 replies; 8+ messages in thread
From: shiv @ 2002-03-06 17:33 UTC (permalink / raw)
To: caml-list
On Wednesday, March 6, 2002, at 02:24 AM, Xavier Leroy wrote:
> Do others think that it would be useful?
Yes, it would be useful for me. I have a matlab-like top-level and it
would save me a lot of key-strokes.
--shiv--
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [Caml-list] Re: Toplevel question ...
@ 2002-03-04 17:10 Harrison, John R
2002-03-04 18:42 ` Daniel de Rauglaudre
0 siblings, 1 reply; 8+ messages in thread
From: Harrison, John R @ 2002-03-04 17:10 UTC (permalink / raw)
To: 'Andrzej M. Ostruszka', Caml List; +Cc: Harrison, John R
Tomasz Zielonka writes:
> > Is there some alias in toplevel for the result of last evaluation so one
> > could use it instead of retyping (there's no history completion :() and
> > binding to some name?
I don't think so, but I also wish there were. Some other implementations
of ML automatically bind the result of the previous evaluation to a
special identifier "it", treating an expression "E" as "let it = E". This
is really useful if, like me, you work in the toplevel a lot and often
want to evaluate ad hoc chains of dependent expressions.
Even if the OCaml developers don't want to add this feature to the
default toplevel, it must be very easy to support using Camlp4. Perhaps
Daniel de Rauglaudre or another expert can tell us how?
John.
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-03-06 17:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-28 15:49 [Caml-list] Toplevel question Andrzej M. Ostruszka
2002-03-01 9:36 ` Tomasz Zielonka
2002-03-02 10:25 ` [Caml-list] " Andrzej M. Ostruszka
2002-03-06 10:24 ` [Caml-list] " Xavier Leroy
2002-03-06 10:41 ` Mattias Waldau
2002-03-06 17:33 ` shiv
2002-03-04 17:10 [Caml-list] " Harrison, John R
2002-03-04 18:42 ` Daniel de Rauglaudre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox