From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id B4F4D5D5 for ; Fri, 5 Mar 2021 14:04:23 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.81,224,1610406000"; d="scan'208";a="496366134" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 05 Mar 2021 15:04:22 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id 5840FE1D3E; Fri, 5 Mar 2021 15:04:22 +0100 (CET) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id A0E93E0171 for ; Fri, 5 Mar 2021 15:04:18 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=asai@is.ocha.ac.jp; spf=Pass smtp.mailfrom=asai@is.ocha.ac.jp; spf=None smtp.helo=postmaster@web.is.ocha.ac.jp IronPort-PHdr: =?us-ascii?q?9a23=3A1s1YuB2BwdFoaBDSsmDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?seIQK/ad9pjvdHbS+e9qxAeQG9mCurQd07ed6vm7EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRp?= =?us-ascii?q?OOv1BpTSj8Oq3Oyu5pHfeQpFiCe5bL9oMRm6sQXcusYLjYd/JKs61wfErGZPd+?= =?us-ascii?q?lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLe?= =?us-ascii?q?TQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgz?= =?us-ascii?q?ocOjUn7G/YlNB/jKNDoBKguRN/xZLUYJqIP/Z6Z6/RYM8WSXZEUstXSidPAJ6z?= =?us-ascii?q?b5EXAuQPPehWsZTzqVgArRSxGQajGeHgxyRUhnPqx6A2z/gtHR3Y0AEmAtkAsG?= =?us-ascii?q?7UrNLwNKoKVO660q/IzTTfYPNW2Df29ZTFcgs7rvGNQLl9dtDeyVI1GAPElViQ?= =?us-ascii?q?qJflMymS1usRs2iU9fBsWvizhGI9qQFxuiGiy8ExgYbGmowb0ErL9TllwIkrP9?= =?us-ascii?q?24TlZ2bNy4HJVfqSyUN4R7TMwmTmxovCs21KALtJq/cSUXyZkq2hrSZ+KHfoWH?= =?us-ascii?q?7B/vSeafLDhmiX57Zb+zmwq+/VW9xuD6S8K6005KozJYntTCuH0BzR3e58idRv?= =?us-ascii?q?Z88UqtwyuD2xzL5u1aI004j67WJ4A7zrM0ipYfq0bOEjHwlU7rlqGZbF8k9fKt?= =?us-ascii?q?6+n/YrXpuJucN4hshwDwLKshgdazAeUjMgQUWGiU5eS826f58ULjXLpGlP82kr?= =?us-ascii?q?HBvJDbI8QUuLK5DhdI3ost5RuzFTar3dQCkXQGI19JYg+Lg5TxN1HLOv/4DPO/?= =?us-ascii?q?g1q2kDdswvDLJqfuAo7XIXjCi7rhfK1951RbyAUvzdBQ/YhYBasdL/7pWE/xrM?= =?us-ascii?q?TUDgUlPAys3+bnFNJ925sCVm2VB6+ZNLresVuJ5uI0P+mBf5QVuTb4K/g9/fHi?= =?us-ascii?q?l345mVkHfamox5Qbcn64Hu41a3meNFjhmNoEEGpCkgs7TertwAmAXT9WZnC1d6?= =?us-ascii?q?A14DwgFJirAJuFTYeo1u+vxiC+S75bYGFNClHEOGzhds3QUuwFaQqTOYlmmTwN?= =?us-ascii?q?E7GqDY05g0L9/DTmwqZqe7KHshYTsojugZ0sv7WKxEMCsAdsBsHY6FmjCmR9n2?= =?us-ascii?q?cGXTgzhf0toFc7zVyD2O5xiLpaDY4Kvq8bYkIBLZfZitdCJZXqQAuYI4WIUxCh?= =?us-ascii?q?SdWvRzg6CNApkYdXPhRNXu66hxWG5BKERr8Yk7vSVc4r/6ia3mO3IM19wjDP3+?= =?us-ascii?q?8jlwt+Tw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CIAAAUOUJglwpAQYViHQEBAQEJARIBB?= =?us-ascii?q?QUBQIFPgyFYODGNRaUoAgkBAwELAQEgEgIEAQGETQKBegIdBwEENBMCEAEBBQE?= =?us-ascii?q?BAQIBAwMEARMBAQEBAQEBAQkWBoYRDYI4KQGDYwIEEhUTPxALDjg0AQUBHAY1g?= =?us-ascii?q?k4BgwYBoTSBBD2KPnSBATOIaCFNgQ4SgSeNQkKCC4QrPogIgisEgkZ8gRdARY1?= =?us-ascii?q?NB4NMjUScBIMIgy+GEZJXAg0ihG6OW5Ajhk2wPAIKBwYQI4FIgXozGggwO4JpC?= =?us-ascii?q?UcZDY44h3aGSDMxOAIGCgEBAwlWJhOOFwEB?= X-IPAS-Result: =?us-ascii?q?A0CIAAAUOUJglwpAQYViHQEBAQEJARIBBQUBQIFPgyFYODG?= =?us-ascii?q?NRaUoAgkBAwELAQEgEgIEAQGETQKBegIdBwEENBMCEAEBBQEBAQIBAwMEARMBA?= =?us-ascii?q?QEBAQEBAQkWBoYRDYI4KQGDYwIEEhUTPxALDjg0AQUBHAY1gk4BgwYBoTSBBD2?= =?us-ascii?q?KPnSBATOIaCFNgQ4SgSeNQkKCC4QrPogIgisEgkZ8gRdARY1NB4NMjUScBIMIg?= =?us-ascii?q?y+GEZJXAg0ihG6OW5Ajhk2wPAIKBwYQI4FIgXozGggwO4JpCUcZDY44h3aGSDM?= =?us-ascii?q?xOAIGCgEBAwlWJhOOFwEB?= X-IronPort-AV: E=Sophos;i="5.81,224,1610406000"; d="scan'208";a="374899414" X-MGA-submission: =?us-ascii?q?MDG66faw4rUfjB0yyCGPmT1JCFGDlEDYmTwZyA?= =?us-ascii?q?Nr6pwBybXjoRy85dLH7i7MTImVInjiZ6rMv5ikdNKOodSQoAjq3b7Lih?= =?us-ascii?q?V9lJ2Wvd9iK4fpqBFA3xkBAKGK9khyg5Km+T51CVNOdMTKS17krqd9Pg?= =?us-ascii?q?zmKOswgOIthRDooVEl/Lh8Rg=3D=3D?= Received: from web.is.ocha.ac.jp ([133.65.64.10]) by mail3-smtp-sop.national.inria.fr with ESMTP; 05 Mar 2021 15:04:16 +0100 Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by web.is.ocha.ac.jp (Postfix) with ESMTP id D0BFF360057 for ; Fri, 5 Mar 2021 23:04:13 +0900 (JST) Received: by mail-pl1-f197.google.com with SMTP id m1so1507787pll.0 for ; Fri, 05 Mar 2021 06:04:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=EUdre8ADxenUZGtErqH4y5qpJT9fnTnNGhn5sMvo6sU=; b=bjCqUmadK7wGyzf2139iEcuDNtM3ajjD98bX0OjcBaoqtTlpqZltk+h4nKBEqoiW0d Sw+pc8vkfWYm9YCVdEV6mXhJ2v9njSYFFzX7ifel/b3mDcM4ecdp9AFfdFOuH8IjUapu UjtON4L2T9Ty8OJnMovgT7nlbbUoYf9GVoz79UbmDzMAJicFcxnk8D90G9h4I7Z/TTp/ jhfowNMAPiwBIw+29+6L0jE4RJD8NIyD4aRhz4LV+nmbUYsWB8SH9jd7WXhIbxSa3PAx blaJiVw9jpUWPWwyEL1T0Zn72ZOdS/hiG9utsRAnW/GuIXxFHAPEcyKLwuFnCgL4Yp4C G6Yg== X-Gm-Message-State: AOAM533+5oixGR+Vu0gk0JF8xoShB4v6QWVyz80zapq/8P/wrhT9eaSC k4/DyZJO/TxFgFmaXXXvZ2wiLxLjeTVGI+coPC7tkkKO2E0daK+zFwmZB+1ero/F/bvKmKRtHrg v5F/GjXJlUZSQ X-Received: by 2002:a17:90b:1105:: with SMTP id gi5mr10278058pjb.26.1614953053303; Fri, 05 Mar 2021 06:04:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNHcukqZ/YMWCXZ4SZcCCX3jPAbldSoOwRpDhxHTU8l6BbZOxRcjZ2U/B4q3isIFTmvirwcQ== X-Received: by 2002:a17:90b:1105:: with SMTP id gi5mr10278032pjb.26.1614953053047; Fri, 05 Mar 2021 06:04:13 -0800 (PST) Received: from localhost (KD027092090072.ppp-bb.dion.ne.jp. [27.92.90.72]) by smtp.gmail.com with ESMTPSA id 186sm861207pfb.143.2021.03.05.06.04.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 06:04:12 -0800 (PST) Date: Fri, 5 Mar 2021 23:03:34 +0900 From: Kenichi Asai To: Jeremie Dimino Cc: caml users Message-ID: <20210305140334.GA6750@pllab.is.ocha.ac.jp> References: <20210305050509.GA97697@pllab.is.ocha.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Caml-list] a simple example of compiler-libs.toplevel? Reply-To: Kenichi Asai X-Loop: caml-list@inria.fr X-Sequence: 18418 Errors-To: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: Thanks for the e-mail, Jeremie! Your example first modifies Toploop.read_interactive_input and then calls the original Topmain.main. Because toploop.ml had a hook for reading interactive input, we could change the character for the prompt. A side question. How can I find what hooks are available? By looking at the source and finding what functions are defined as refs? (I find that parse_toplevel_phrase, parse_use_file, and toplevel_startup_hook are defined as refs in toploop.ml, so they can be replaced?) What if there is no such hook? For the type debugger, I want to call a specific function whenever a type error occurs in the second execute_phrase (right after "with exn ->") in toploop.ml. But there is no hook there. Since the execute_phrase function is not defined as a ref, I cannot replace it, either. What can I do then? -- Kenichi Asai