| |
| /pliant/language/compiler/type/type2.pli |
| |
| 1 |
# Copyright Hubert Tonneau hubert.tonneau@pliant.cx | |
| 2 |
# | |
| 3 |
# This program is free software; you can redistribute it and/or | |
| 4 |
# modify it under the terms of the GNU General Public License version 2 | |
| 5 |
# as published by the Free Software Foundation. | |
| 6 |
# | |
| 7 |
# This program is distributed in the hope that it will be useful, | |
| 8 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 9 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 10 |
# GNU General Public License for more details. | |
| 11 |
# | |
| 12 |
# You should have received a copy of the GNU General Public License | |
| 13 |
# version 2 along with this program; if not, write to the Free Software | |
| 14 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
| 15 |
| |
| 16 |
scope "/pliant/language/" "/pliant/install/" | |
| 17 |
module "/pliant/install/ring1.pli" | |
| 18 |
| |
| 19 |
public | |
| 20 |
| |
| 21 |
meta '. maybe' e | |
| 22 |
if e:size<2 | |
| 23 |
return | |
| 24 |
for (var Int i) 0 e:size-1 | |
| 25 |
if (e:i constant Type)=null | |
| 26 |
return | |
| 27 |
for (var Int i) 1 e:size-1 | |
| 28 |
((e:0 constant Type) map Type) maybe ((e:i constant Type) map Type) | |
| 29 |
e set_void_result | |
| 30 |
| |
| 31 |
| |
| 32 |
method t bitsize -> n | |
| 33 |
arg Type t ; arg Int n | |
| 34 |
n := t:size*8 | |
| 35 |
| |
| 36 |
method t read_only_size -> n | |
| 37 |
arg Type t ; arg Int n | |
| 38 |
weak_definition | |
| 39 |
n := t size | |
| 40 |
| |
| 41 |
alias '. size' '. read_only_size' in "/pliant/language/basic/unsafe.pli" | |
| |