Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Question on language design (keywords vs Pervasives)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Kwangkeun Yi <kwang@r...>
Subject: Re: Question on language design (keywords vs Pervasives)
> I'm sure that there is no ``more primitive function'' than raise to
> raise an exception. So sorry, you cannot define raise ``in terms of a
> more primitive function'' in Caml. You would need a language with
> call/cc to express that, and Caml is not this language.

To make it precise, we don't even need call/cc. 
Just a kind of cps transformation that carries two continuations (one
for normal continuation and the other for handler continuation)
removes all the raise/try expressions. The transformation is
well-known. See 

  author =       "Jung-taek Kim and Kwangkeun Yi and Olivier Danvy",
  title =        "Assessing the Overhead of ML Exceptions by Selective
                  CPS Transformation",
  pages =     "103-114",
  booktitle = "The Proceedings of the ACM SIGPLAN Workshop on ML",
  year =      1998,
  url = "",
  month =     sep


Kwangkeun Yi