rapidfx: переводы
Inferno Programmer's Guide / Руководство программиста по ОС Inferno
→Point: adt {... } ;
p : Point;
pp : ref Point;
p = Point(l, 2);
pp = ref p; # Gives *pp the same value as p
p = Point(3, 4);# This makes *pp differ from p
*pp= Point(4, 5);# This does not affect p
p : Point;
pp : ref Point;
p = Point(l, 2);
pp = ref p; # Gives *pp the same value as p
p = Point(3, 4);# This makes *pp differ from p
*pp= Point(4, 5);# This does not affect p
0 Point: adt {... } ;
p : Point;
pp : ref Point;
p = Point(l, 2);
pp = ref p; # Присваивает те же значения *pp что и у p
p = Point(3, 4);# Изменяет *pp от p
*pp= Point(4, 5);# Не влияет на p
p : Point;
pp : ref Point;
p = Point(l, 2);
pp = ref p; # Присваивает те же значения *pp что и у p
p = Point(3, 4);# Изменяет *pp от p
*pp= Point(4, 5);# Не влияет на p
→One's complement
0 Оператор дополнения
→Head and tail
0 Head и tail / Получение головы и хвоста списка
→Monadic additive operators
0 Монадические операторы сложения
→Logical negation
0 Логическое инвертирование/отрицание
→Monadic Expressions
0 Монадические выражения
→Increment and decrement
0 Инкремент и декремент
→Function calls
0 Вызовы функций
→Tin := load Linear "/dis/linear.dis"; vector, TRUNCATE, setflags : import Tin; a : array of real;
vl : vector; v2 : vector; set-flags (TRUNCATE); vl = vector.make(a); vl = vl.make(a); vl = vl.add(vl); vl.v = nil;
vl : vector; v2 : vector; set-flags (TRUNCATE); vl = vector.make(a); vl = vl.make(a); vl = vl.add(vl); vl.v = nil;
0 Tin := load Linear "/dis/linear.dis"; vector, TRUNCATE, setflags : import Tin; a : array of real;
vl : vector; v2 : vector; set-flags (TRUNCATE); vl = vector.make(a); vl = vl.make(a); vl = vl.add(vl); vl.v = nil;
vl : vector; v2 : vector; set-flags (TRUNCATE); vl = vector.make(a); vl = vl.make(a); vl = vl.add(vl); vl.v = nil;
→vl = 1in->vector.make(a);#wrong
vl = 1in->Linear->vector.make(a);#wrong
vl = 1in->Linear->vector.make(a);#wrong
0 vl = 1in->vector.make(a);#wrong
vl = 1in->Linear->vector.make(a);#wrong
vl = 1in->Linear->vector.make(a);#wrong
→Here, the declarations for vl and v2 are equivalent; either a module type name (here, Li near) or a handle (here, 1 i n) suffices to identify the module. In the call to setf 1 ags, a handle is required for the call itself; the type name is sufficient for the constant.
0 Здесь, объявления vl и v2 одинаковы; оба имени типа модуль ( Linear) или хэндл (Tin) достаточны для идентификации модуля. В вызове setflags, необходим хэндл для для обращения самому себе; имя типа достаточно для константы.
→vl = 1in->vl.make(a);
0 vl = 1in->vl.make(a);
→vl = 1in->(Linear->vector) .tnake(a) ;
0 vl = 1in->(Linear->vector) .tnake(a) ;
→Linear : module {
setflags : fn (flag : int); TRUNCATE : con 1; vector : adt {
v : array of real;
add : fn (vl : self vector, v2: vector) : vector;
make : fn(v : array of real) : vector;
}; };
one might say:
Tin := load Linear "/dis/linear.dis"; a : array of real;
vl : Tin -> vector;
v2 : Linear -> vector;
1i n->setf1ags (Li near->TRUNCATE);
vl = 1in->(Linear->vector).make(a);
vl = 1in->vl.make(a);
vl = 1in->vl.add(vl);
vl.v = nil;
setflags : fn (flag : int); TRUNCATE : con 1; vector : adt {
v : array of real;
add : fn (vl : self vector, v2: vector) : vector;
make : fn(v : array of real) : vector;
}; };
one might say:
Tin := load Linear "/dis/linear.dis"; a : array of real;
vl : Tin -> vector;
v2 : Linear -> vector;
1i n->setf1ags (Li near->TRUNCATE);
vl = 1in->(Linear->vector).make(a);
vl = 1in->vl.make(a);
vl = 1in->vl.add(vl);
vl.v = nil;
0 Linear : module {
setflags : fn (flag : int); TRUNCATE : con 1; vector : adt {
v : array of real;
add : fn (vl : self vector, v2: vector) : vector;
make : fn(v : array of real) : vector;
}; };
one might say:
Tin := load Linear "/dis/linear.dis"; a : array of real;
vl : Tin -> vector;
v2 : Linear -> vector;
1i n->setf1ags (Li near->TRUNCATE);
vl = 1in->(Linear->vector).make(a);
vl = 1in->vl.make(a);
vl = 1in->vl.add(vl);
vl.v = nil;
setflags : fn (flag : int); TRUNCATE : con 1; vector : adt {
v : array of real;
add : fn (vl : self vector, v2: vector) : vector;
make : fn(v : array of real) : vector;
}; };
one might say:
Tin := load Linear "/dis/linear.dis"; a : array of real;
vl : Tin -> vector;
v2 : Linear -> vector;
1i n->setf1ags (Li near->TRUNCATE);
vl = 1in->(Linear->vector).make(a);
vl = 1in->vl.make(a);
vl = 1in->vl.add(vl);
vl.v = nil;
→An example using an abridged version of an example given above:
0 Пример использующий урезанную версию вышесказанного:
→A term of the form:
term -> term
denotes module qualification. The first term identifies a module: either it is a module type name, or it is an expression of module type. The second term is a constant name, type, data object, or function specified within that module's declaration. Either the module type name or an object of the module's type suffices to qualify constants and types; functions and objects directly exported by the module or contained within its adt must be qualified by an object of the module's type, initialized with 1 oad.
term -> term
denotes module qualification. The first term identifies a module: either it is a module type name, or it is an expression of module type. The second term is a constant name, type, data object, or function specified within that module's declaration. Either the module type name or an object of the module's type suffices to qualify constants and types; functions and objects directly exported by the module or contained within its adt must be qualified by an object of the module's type, initialized with 1 oad.
0 Обозначается в виде:
элемент -> элемент
означает принадлежность модулю. Первый элемент определяет модуль: это может быть и имя типа модуль или выражение типа модуль. Второй элемент является именем константы, типом, объектом данных или функцией указанной в объявлении модуля. В любом случае, будь то имя типа модуль или объект типа модуль, этого достаточно для определения констант или типов; функции и объекты непосредственно экспортируемые модулем и содержащие в себе adt должны быть уточнены объектом типа модуль, инициализированные оператором load.
элемент -> элемент
означает принадлежность модулю. Первый элемент определяет модуль: это может быть и имя типа модуль или выражение типа модуль. Второй элемент является именем константы, типом, объектом данных или функцией указанной в объявлении модуля. В любом случае, будь то имя типа модуль или объект типа модуль, этого достаточно для определения констант или типов; функции и объекты непосредственно экспортируемые модулем и содержащие в себе adt должны быть уточнены объектом типа модуль, инициализированные оператором load.
→Module qualification
0 Определение модуля
→In a term of the form:
term [.expression : expression]
term [.expression : expression]
0 Вычленение подстроки происходит следующим образом:
term [.expression : expression]
term [.expression : expression]
→Slicing
0 Слайс
→Infrared Remote Control
0 Инфракрасное дистанционное управление
Резюме
- Пол:
- мужчина
- Родной язык:
- русский
- С нами:
- с 13 апреля 2009 г. (6395 дней)
- Деятельность:
-
1085 версий перевода
с общим рейтингом 0
3 комментария
Карма: 2 (оценок: 2)
