Changeset 863
- Timestamp:
- Jun 22, 2003, 10:51:01 AM (18 years ago)
- Location:
- to-imperative/trunk/library
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
to-imperative/trunk/library/Box/get.cc
r503 r863 16 16 if (_box.get_len() == 1) { 17 17 Term* t = _box.get_first(); 18 if (t->get_type() == type_box) { 19 try { 20 rftype::Box& b = dynamic_cast<rftype::Box&>(t->get_object()); 21 _expr = b.get(); 22 } catch (std::bad_cast&) { 23 FATAL("Box::?(): An object does not seem to be a box"); 24 } 18 rftype::Box* b = t->cast_to<rftype::Box>(type_box); 19 if (b) { 20 _expr = b->get(); 25 21 } else { 26 22 FATAL("Box::?(): Symbol does not have a box type"); -
to-imperative/trunk/library/Box/put.cc
r503 r863 16 16 if (_box.get_len() == 1) { 17 17 Term* t = _box.get_first(); 18 if (t->get_type() == type_box) { 19 try { 20 rftype::Box& b = dynamic_cast<rftype::Box&>(t->get_object()); 21 b.put(_expr); 22 } catch (std::bad_cast&) { 23 FATAL("Box::Store(): An object does not seem to be a box"); 24 } 18 rftype::Box* b = t->cast_to<rftype::Box>(type_box); 19 if (b) { 20 b->put(_expr); 25 21 } else { 26 22 FATAL("Box::Store(): Symbol does not have a box type"); -
to-imperative/trunk/library/StdIO/open_file.cc
r839 r863 26 26 if (_channel.get_len() == 1) { 27 27 Term* p = _channel.get_first(); 28 if (p->get_type() == type_object) {29 Channel& ch = dynamic_cast<Channel&>(p->get_object());28 Channel* ch = p->cast_to<Channel>(type_channel); 29 if (ch) { 30 30 if (_mode.get_len() == 1) { 31 31 Term* p = _mode.get_first(); … … 40 40 wcstombs(mode, ws.get_data(), len + 1); 41 41 mode[len] = 0; 42 if (!ch .open(fname, mode)) {42 if (!ch->open(fname, mode)) { 43 43 throw Word::create_expr(L"Open-File") + 44 44 Word::create_expr(strerror(errno)); -
to-imperative/trunk/library/StdIO/print_e_.cc
r840 r863 16 16 if (_channel.get_len() == 1) { 17 17 Term* p = _channel.get_first(); 18 if (p->get_type() == type_object) {19 Channel& ch = dynamic_cast<Channel&>(p->get_object());20 FILE* fp = ch .get_fp();18 Channel* ch = p->cast_to<Channel>(type_channel); 19 if (ch) { 20 FILE* fp = ch->get_fp(); 21 21 if (fp == NULL) { 22 22 throw Word::create_expr(L"Print!") + -
to-imperative/trunk/library/StdIO/write_e_.cc
r840 r863 17 17 if (_channel.get_len() == 1) { 18 18 Term* p = _channel.get_first(); 19 if (p->get_type() == type_object) {20 Channel& ch = dynamic_cast<Channel&>(p->get_object());21 FILE* fp = ch .get_fp();19 Channel* ch = p->cast_to<Channel>(type_channel); 20 if (ch) { 21 FILE* fp = ch->get_fp(); 22 22 if (fp == NULL) { 23 23 throw Word::create_expr(L"Write!") +
Note: See TracChangeset
for help on using the changeset viewer.