logo       

Nice/src/bossa/syntax monotype.nice,NONE,1.1 symbol.nice,1.1,1.2 tools.nice: msg#00024

Subject: Nice/src/bossa/syntax monotype.nice,NONE,1.1 symbol.nice,1.1,1.2 tools.nice,1.72,1.73 FunType.java,1.29,NONE
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2818/F:/nice/src/bossa/syntax

Modified Files:
        symbol.nice tools.nice 
Added Files:
        monotype.nice 
Removed Files:
        FunType.java 
Log Message:
Converted FunType.

Index: tools.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** tools.nice  14 Dec 2004 22:49:12 -0000      1.72
--- tools.nice  15 Dec 2004 03:45:59 -0000      1.73
***************
*** 260,263 ****
--- 260,266 ----
  List<FormalParameters.Parameter> getRequiredParameters(FormalParameters) = 
native List FormalParameters.getRequiredParameters();
  List<FormalParameters.Parameter> asList(FormalParameters) = native List 
FormalParameters.asList();
+ boolean containsAlike(Monotype[]) = native boolean 
Monotype.containsAlike(Monotype[]);
+ bossa.syntax.Monotype[] 
substitute(Map<String,bossa.syntax.Monotype>,bossa.syntax.Monotype[]) = native 
bossa.syntax.Monotype[] 
bossa.syntax.Monotype.substitute(Map,bossa.syntax.Monotype[]);
+ Monotype[?] types(FormalParameters) = native Monotype[] 
FormalParameters.types();
  
  // Retypings needed since java types are not strict.

--- NEW FILE: monotype.nice ---
/**************************************************************************/
/*                                N I C E                                 */
/*             A high-level object-oriented research language             */
/*                        (c) Daniel Bonniot 2004                         */
/*                                                                        */
/*  This program is free software; you can redistribute it and/or modify  */
/*  it under the terms of the GNU General Public License as published by  */
/*  the Free Software Foundation; either version 2 of the License, or     */
/*  (at your option) any later version.                                   */
/*                                                                        */
/**************************************************************************/

package bossa.syntax;

import bossa.util.*;

/**
   Functional type.

 */
public class FunType extends bossa.syntax.Monotype
{
  private bossa.syntax.Monotype[] in;
  private bossa.syntax.Monotype out;

  rawResolve(typeMap)
  {
    return new mlsub.typing.FunType
      (bossa.syntax.Monotype.resolve(notNull(typeMap), in),
       out.resolve(typeMap));
  }

 substitute(map)
  {
    bossa.syntax.Monotype res = new bossa.syntax.FunType
      (in: bossa.syntax.Monotype.substitute(map,in), out: out.substitute(map));
    res.nullness = this.nullness;
    return res;
  }

  containsAlike() = Monotype.containsAlike(in) || out.containsAlike();
  
  location() = out.location();

  toString()
  {
    return "(" + Util.map("", ", ", "", in) + 
      (nullness == maybe ? ")?->" : ")->") + out;
  }
  
  toStringExtern() = "(" + Util.map("", ", ", "", in) + ")->" + 
out.toStringExtern();
}

public FunType createFunType(?List<bossa.syntax.Monotype> in, 
                 bossa.syntax.Monotype out)
{
  return new FunType(in: (in != null ? in.toArray() : []), out: out);
}

public FunType createFunType_(bossa.syntax.Monotype[?] in, 
bossa.syntax.Monotype out)
{
  return new FunType(in: (in != null ? in : []), out: out);
}

--- FunType.java DELETED ---

Index: symbol.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/symbol.nice,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** symbol.nice 21 Nov 2004 23:24:37 -0000      1.1
--- symbol.nice 15 Dec 2004 03:45:59 -0000      1.2
***************
*** 138,142 ****
  {
    this(name, parameters: parameters, arity: parameters.size, syntacticType:
!       new Polytype(constraint, new FunType(parameters.types(), returnType)));
  }
  
--- 138,142 ----
  {
    this(name, parameters: parameters, arity: parameters.size, syntacticType:
!       new Polytype(constraint, createFunType(parameters.types(), 
returnType)));
  }
  
***************
*** 200,204 ****
    FormalParameters parameters = declaration.formalParameters();
    this(name, declaration: declaration, parameters: parameters, arity: 
parameters.size,
!       syntacticType: new Polytype(constraint, new FunType(parameters.types(), 
returnType)));
  }
  
--- 200,204 ----
    FormalParameters parameters = declaration.formalParameters();
    this(name, declaration: declaration, parameters: parameters, arity: 
parameters.size,
!       syntacticType: new Polytype(constraint, 
createFunType(parameters.types(), returnType)));
  }
  



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe