Chrome (programming language)

From Wikipedia, the free encyclopedia

(Redirected from Chrome programming language)
Jump to: navigation, search
Chrome
Image:Chrome-150-White.png
Developer RemObjects Software
Latest release 2.0.5.431 / October 25, 2007
OS Common Language Infrastructure
Genre Programming Language
License Commercial
Website Chrome Homepage

Chrome is a programming language for the Common Language Infrastructure developed by RemObjects Software. Chrome is Object Pascal based.

Compared to Delphi.NET, developed by Borland, Chrome does not emphasize total backward compatibility.

RemObjects Software offers full integration into Visual Studio 2003/2005/2008. There is no stand-alone Chrome IDE.

Contents

namespace HelloWorld;
 
interface
 
type
  HelloClass = class
  public
    class method Main; 
  end;
 
implementation
 
class method HelloClass.Main;
begin
  System.Console.WriteLine('Hello World!');
end;
 
end.

namespace GenericContainer;
 
interface
 
type
  TestApp = class
  public
    class method Main;
  end;
 
  Person = class
  public
    property FirstName: String;
    property LastName: String;      
  end;        
 
implementation
 
uses 
  System.Collections.Generic;
 
class method TestApp.Main;
begin
  var myList := new List; //type inference
  myList.Add(new Person(FirstName := 'John', LastName := 'Doe'));  
  myList.Add(new Person(FirstName := 'Jane', LastName := 'Doe'));
  myList.Add(new Person(FirstName := 'James', LastName := 'Doe'));  
  Console.WriteLine(myList[1].FirstName);  //No casting needed
  Console.ReadLine;        
end;
 
end.

namespace GenericMethodTest;
 
interface
 
type
GenericMethodTest = static class
public
  class method Main;
private
  class method Swap(var left, right : T);
  class method DoSwap(left, right : T);
end;
 
implementation
 
class method GenericMethodTest.DoSwap(left, right : T);
begin
  var a := left;
  var b := right;
  Console.WriteLine('Type: {0}', typeof(T));
  Console.WriteLine('-> a = {0}, b = {1}', a , b);
  Swap(var a, var b);
  Console.WriteLine('-> a = {0}, b = {1}', a , b);
end;
 
class method GenericMethodTest.Main;
begin
  var a := 23;// type inference
  var b := 15;
  DoSwap(a, b); // no downcasting to Object in this method.
 
  var aa := 'abc';// type inference
  var bb := 'def';
  DoSwap(aa, bb); // no downcasting to Object in this method.
 
  DoSwap(1.1, 1.2); // type inference for generic parameters
  Console.ReadLine();
end;
 
class method GenericMethodTest.Swap(var left, right : T);
begin
  var temp := left;
  left:= right;
  right := temp;
end;
 
end.

Program Output:

Type: System.Int32
-> a = 23, b = 15
-> a = 15, b = 23
Type: System.String
-> a = abc, b = def
-> a = def, b = abc
Type: System.Double
-> a = 1,1, b = 1,2
-> a = 1,2, b = 1,1

case aClassID.ToUpper of
   'XYZ': result := TMyXYZClass;
   'ABC': result := TMyOtherClass;
else raise new Exception('Invalid Class ID');
end;
case aClass type of
   TMyXYZClass: TMyXYZClass(aClass).DoSomething;
   TMyOtherClass: TMyOtherClass(aClass).DoSomethingElse;
else raise new Exception('Invalid Class Reference');
end;

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.