Giter Site home page Giter Site logo

uarini's Introduction

ooErlang

https://sites.google.com/site/ooerlang1/

What is this?

ooErlang is an object oriented extension to the Erlang programming language. Objects are introduced with a syntax close to Java, making easier its adoption by object-oriented programmers.

How to Install?

  1. get the source
  2. build
$ cd $OOERLANG_SOURCE_DIR
$ make
  1. configure PATH
# in .bashrc add:
export OOE_HOME=<PATH_TO_OOERLANG_DIR>
export PATH=$PATH:$OOE_HOME

Requirements

  • Erlang and Make

Getting Start

% simple_calculator.cerl
-class(simple_calculator).
-constructor([new/1]).
-export([add/1, sub/1, mult/1, divi/1, clear/0, result/0]).
-export([usage_example/0]).

attributes.
Result = 0.

methods.
new(Value) -> self::Result = Value.

add(Value) -> self::Result = self::Result + Value.
sub(Value) -> self::Result = self::Result - Value.
mult(Value) -> self::Result = self::Result * Value.
divi(Value) -> self::Result = self::Result / Value.

clear() -> self::Result = 0.
result() -> self::Result.

class_methods.
% example of ((2 + 3 - 1) * 3) / 4 = 3
usage_example() ->
    Calculator = simple_calculator::new(2),
    Calculator::add(3),
    Calculator::sub(1),
    Calculator::mult(3),
    Calculator::divi(4),
    Calculator::result().

Build using Erlang Shell

$ erl -pa $(OOE_HOME)/ebin
Eshell v6.0 (abort with ^G)
1> ooec:compile(["simple_calculator.cerl"]).

[{ok, simple_calculator}]
2> simple_calculator:usage_example().
3.0

uarini's People

Contributors

danielhba avatar jucimarjr avatar miliox avatar williambelleza avatar rbbernardino avatar julianafigueira avatar filipevarjao avatar

Stargazers

Pesquisador do Laboratório de Projetos Especiais da UEA/EST avatar  avatar  avatar  avatar

Watchers

 avatar  avatar James Cloos avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.