From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA08998 for caml-redistribution@pauillac.inria.fr; Wed, 16 Feb 2000 10:39:39 +0100 (MET) Resent-Message-Id: <200002160939.KAA08998@pauillac.inria.fr> Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id FAA27514 for ; Tue, 15 Feb 2000 05:01:00 +0100 (MET) Received: from ruby (krusty18.zip.com.au [61.8.16.18]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id FAA07465 for ; Tue, 15 Feb 2000 05:00:51 +0100 (MET) Received: from maxtal.com.au (IDENT:root@localhost [127.0.0.1]) by ruby (8.9.3/8.9.3) with ESMTP id PAA22852 for ; Tue, 15 Feb 2000 15:01:30 +1100 Sender: root@ruby Message-ID: <38A8CF94.458C3F53@maxtal.com.au> Date: Tue, 15 Feb 2000 15:01:24 +1100 From: skaller Organization: Maxtal X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.12 i586) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.python.announce,comp.lang.python To: caml-list@inria.fr Subject: Vyper source available vi CVS at SourceForge Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-From: weis@pauillac.inria.fr Resent-Date: Wed, 16 Feb 2000 10:39:39 +0100 Resent-To: caml-redistribution@pauillac.inria.fr The full sources for my Vyper interpreter are now available at SourceForge via CVS. Vyper is now licenced LGPL. Developers are urgently required for library development, especially python compatibility modules. [No documentation is available yet -- I'm still trying to figure out how to get it onto source forge] Vyper is written in Ocaml 3.00 (http://caml.inria.fr). Project Full Name: Vyper Project Unix Name: Vyper CVS Server: cvs.Vyper.sourceforge.net Shell/Web Server: Vyper.sourceforge.net The latest version of Vyper contains functional style pattern matching, as illustrated by the code below: matching includes constants, ranges, regular expressions, tuples and lists, when guards, as names, and type checks. Vyper also now supports anonymous functions with the <: :> brackets: ----------------- anonymous function examples ------------------- xx = <: return 1; :> x = 1 + <: return 10 :> + 100 print x x = 1 + ( 1 - <: return 10 :> + 100 ) + 77 print x a = 2 b = <: a = 1; return a :> print 'a =',a with: x = "Sum to 10 is " + <: s = "" for i in range(10): s = s + str(i)+", " return s :> + " so there" + <: return <: return " max" :> :> * 2 do: x = x print x z = 1 + <: q =5; return 1 :> + 0 print z ----------------- matching examples ----------------------------- for i in range(0,4): match i: case 1: print 1 case "2": print 2 else: print "no" print "should be 1" match "2": case 1: print 1 case "2": print 2 else: print "no" print "should be 2" y=1 x = 44 match "fred": case x: y=2; x=x; print 'x=',x case 1: print 1 case "2": print 2 else: print "no" print 'y=',y, 'x=',x match 1: case 1 when 0: print 'WHEN 0 ' case 1 when 1: print 'WHEN 1 ' match 1: case 1 as x: print x else: print 'NO MATCH' match (1,2): case (1,2): print "Tuple Matched" else: print "Tuple match failed" match (1,2): case (x,y): print "Tuple Matched, x=",x,"y=",y else: print "Tuple match failed" match [1,2]: case [x,y]: print "List Matched, x=",x,"y=",y else: print "list match failed" match 50: case 1 .. 2: print "1..2" case 30 .. 60: print "30..60 - OK!" match "q": case "a" .. "z": print "letter!" else: print "Not letter?" match (1,2,(3,4)): case ((x,y,(a,b) as z) as e) when x==1: print x,y,z,a,b,z,e else: print "Failed!" match 1: case x when x == 1 and 1 == 1: print "AND MATCH" else: print "Failed!" match 1: case x when x == 0 or 1 == 1: print "OR MATCH" else: print "Failed!" import types match 1: case x ! types.IntType: print "TYPE MATCH" else: print "Failed!" match "Hello": case regexp "He(..)o" (x,y): print 'Matched ',x,y else: print "Regexp Failed" -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850