Version française
Home     About     Download     Resources     Contact us    
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 

@InProceedings{KiYiDa98,
  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 = "http://ropas.kaist.ac.kr/~kwang/paper/98-ml-kiyida.ps.gz",
  month =     sep
}

-Kwang

--
Kwangkeun Yi		http://cs.kaist.ac.kr/~kwang