mirror of
https://github.com/ubf/ubf.git
synced 2026-04-19 03:05:42 +00:00
add UBF(b) types documentation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>UBF Home Page</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /></head><body><div class="article" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id2493076"></a>UBF Home Page</h2></div></div><hr /></div><p>UBF, a framework for Getting Erlang to talk to the outside world.
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>UBF Home Page</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /></head><body><div class="article" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id2987327"></a>UBF Home Page</h2></div></div><hr /></div><p>UBF, a framework for Getting Erlang to talk to the outside world.
|
||||
This document and the corresponding open-source code repositories are
|
||||
based on Joe Armstrong’s original UBF site and code with an MIT
|
||||
license file added to the distribution. Since then, a large number of
|
||||
|
||||
55
misc-codes/irc_plugin.con
Normal file
55
misc-codes/irc_plugin.con
Normal file
@@ -0,0 +1,55 @@
|
||||
+NAME("irc").
|
||||
|
||||
+VSN("ubf1.0").
|
||||
|
||||
+TYPES
|
||||
info() = info;
|
||||
description() = description;
|
||||
contract() = contract;
|
||||
|
||||
ok() = ok;
|
||||
bool() = true | false;
|
||||
nick() = string();
|
||||
oldnick() = nick();
|
||||
newnick() = nick();
|
||||
group() = string();
|
||||
groups() = [group()];
|
||||
|
||||
logon() = logon;
|
||||
proceed() = {ok, nick()};
|
||||
listGroups() = groups;
|
||||
joinGroup() = {join, group()};
|
||||
leaveGroup() = {leave, group()};
|
||||
changeNick() = {nick, nick()};
|
||||
msg() = {msg, group(), string()};
|
||||
|
||||
msgEvent() = {msg, nick(), group(), string()};
|
||||
joinEvent() = {joins, nick(), group()};
|
||||
leaveEvent() = {leaves, nick(), group()};
|
||||
changeNameEvent() = {changesName, oldnick(), newnick(), group()}.
|
||||
|
||||
+STATE start
|
||||
logon() => proceed() & active. %% Nick randomly assigned
|
||||
|
||||
+STATE active
|
||||
listGroups() => groups() & active;
|
||||
joinGroup() => ok() & active;
|
||||
leaveGroup() => ok() & active;
|
||||
changeNick() => bool() & active;
|
||||
msg() => bool() & active; %% False if you have not joined a group
|
||||
|
||||
EVENT => msgEvent(); %% Group sends me a message
|
||||
EVENT => joinEvent(); %% Nick joins group
|
||||
EVENT => leaveEvent(); %% Nick leaves group
|
||||
EVENT => changeNameEvent(). %% Nick changes name
|
||||
|
||||
+ANYSTATE
|
||||
info() => string();
|
||||
description() => string();
|
||||
contract() => term().
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user