Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions base/builtin/bigint.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,14 +648,6 @@ bool B_OrdD_bigintD___ge__ (B_OrdD_bigint wit, B_bigint a, B_bigint b) {

// B_HashableD_bigint ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_bigintD___eq__(B_HashableD_bigint wit, B_bigint a, B_bigint b) {
return zz_equal(&a->val,&b->val);
}

bool B_HashableD_bigintD___ne__(B_HashableD_bigint wit, B_bigint a, B_bigint b) {
return !zz_equal(&a->val,&b->val);
}

B_NoneType B_HashableD_bigintD_hash(B_HashableD_bigint wit, B_bigint a, B_hasher h) {
long sz = a->val.size;
unsigned long data;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,6 @@ bool B_EqD_complexD___ne__ (B_EqD_complex wit, B_complex a, B_complex b) {

// B_HashableD_complex ////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_complexD___eq__(B_HashableD_complex wit, B_complex a, B_complex b) {
return creal(a->val) == creal(b->val) && cimag(a->val) == cimag(b->val);
}

bool B_HashableD_complexD___ne__(B_HashableD_complex wit, B_complex a, B_complex b) {
return !B_HashableD_complexD___eq__(wit,a,b);
}

B_NoneType B_HashableD_complexD_hash(B_HashableD_complex wit, B_complex a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher, to$bytesD_len((char *)&(a->val), 16));
return B_None;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/float.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,6 @@ bool B_OrdD_floatD___ge__ (B_OrdD_float wit, B_float a, B_float b) {

// B_HashableD_float ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_floatD___eq__(B_HashableD_float wit, B_float a, B_float b) {
return a->val == b->val;
}

bool B_HashableD_floatD___ne__(B_HashableD_float wit, B_float a, B_float b) {
return a->val != b->val;
}

B_NoneType B_HashableD_floatD_hash(B_HashableD_float wit, B_float a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher, to$bytesD_len((char *)&a, 8));
return B_None;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/i16.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,6 @@ bool B_OrdD_i16D___ge__ (B_OrdD_i16 wit, B_i16 a, B_i16 b) {

// B_HashableD_i16 ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_i16D___eq__(B_HashableD_i16 wit, B_i16 a, B_i16 b) {
return a->val == b->val;
}

bool B_HashableD_i16D___ne__(B_HashableD_i16 wit, B_i16 a, B_i16 b) {
return a->val != b->val;
}

B_NoneType B_HashableD_i16D_hash(B_HashableD_i16 wit, B_i16 a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher, to$bytesD_len((char *)&(a), 4));
return B_None;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/i32.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,6 @@ bool B_OrdD_i32D___ge__ (B_OrdD_i32 wit, B_i32 a, B_i32 b) {

// B_HashableD_i32 ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_i32D___eq__(B_HashableD_i32 wit, B_i32 a, B_i32 b) {
return a->val == b->val;
}

bool B_HashableD_i32D___ne__(B_HashableD_i32 wit, B_i32 a, B_i32 b) {
return a->val != b->val;
}

B_NoneType B_HashableD_i32D_hash(B_HashableD_i32 wit, B_i32 a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher, to$bytesD_len((char *)&(a), 4));
return B_None;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/i8.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,6 @@ bool B_OrdD_i8D___ge__ (B_OrdD_i8 wit, B_i8 a, B_i8 b) {

// B_HashableD_i8 ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_i8D___eq__(B_HashableD_i8 wit, B_i8 a, B_i8 b) {
return a->val == b->val;
}

bool B_HashableD_i8D___ne__(B_HashableD_i8 wit, B_i8 a, B_i8 b) {
return a->val != b->val;
}

B_NoneType B_HashableD_i8D_hash(B_HashableD_i8 wit, B_i8 a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher, to$bytesD_len((char *)&(a), 4));
return B_None;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/int.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,6 @@ bool B_OrdD_intD___ge__ (B_OrdD_int wit, B_int a, B_int b) {

// B_HashableD_int ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_intD___eq__(B_HashableD_int wit, B_int a, B_int b) {
return a->val == b->val;
}

bool B_HashableD_intD___ne__(B_HashableD_int wit, B_int a, B_int b) {
return a->val != b->val;
}

B_NoneType B_HashableD_intD_hash(B_HashableD_int wit, B_int a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher,to$bytesD_len((char *)&(a->val),8));
return B_None;
Expand Down
35 changes: 1 addition & 34 deletions base/builtin/str.c
Original file line number Diff line number Diff line change
Expand Up @@ -1599,14 +1599,6 @@ bool B_OrdD_strD___ge__ (B_OrdD_str wit, B_str a, B_str b) {

// B_Hashable ///////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_strD___eq__ (B_HashableD_str wit, B_str a, B_str b) {
return strcmp((char *)a->str,(char *)b->str) == 0;
}

bool B_HashableD_strD___ne__ (B_HashableD_str wit, B_str a, B_str b) {
return strcmp((char *)a->str,(char *)b->str) != 0;
}

B_NoneType B_HashableD_strD_hash(B_HashableD_str wit, B_str a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher,to$bytes((char *)a->str));
return B_None;
Expand Down Expand Up @@ -2668,18 +2660,6 @@ struct B_IteratorD_bytearrayG_class B_IteratorD_bytearrayG_methods = {
B_IteratorD_bytearrayD_next
};

B_Iterator B_ContainerD_bytearrayD___iter__ (B_ContainerD_bytearray wit, B_bytearray str) {
return (B_Iterator)$NEW(B_IteratorD_bytearray,str);
}

B_bytearray B_ContainerD_bytearrayD___fromiter__ (B_ContainerD_bytearray wit, B_Iterable wit2, $WORD iter) {
return B_bytearrayD_join(toB_bytearray(""),wit2,iter);
}

int64_t B_ContainerD_bytearrayD___len__ (B_ContainerD_bytearray wit, B_bytearray str) {
return (int64_t)str->nbytes;
}

bool B_ContainerD_bytearrayD___contains__(B_ContainerD_bytearray wit, B_bytearray self, B_int n) {
bool res = false;
for (int i=0; i < self->nbytes; i++) {
Expand Down Expand Up @@ -2761,7 +2741,7 @@ B_NoneType B_SequenceD_bytearrayD_reverse(B_SequenceD_bytearray wit, B_bytearray
B_Iterator B_SequenceD_bytearrayD___reversed__(B_SequenceD_bytearray wit, B_bytearray self) {
B_bytearray copy = B_bytearrayD_copy(self);
B_SequenceD_bytearrayD_reverse(wit,copy);
return B_ContainerD_bytearrayD___iter__ (NULL, copy);
return (B_Iterator)$NEW(B_IteratorD_bytearray,copy);
}

B_bytearray B_SequenceD_bytearrayD___getslice__ (B_SequenceD_bytearray wit, B_bytearray self, B_slice slc) {
Expand Down Expand Up @@ -3901,19 +3881,6 @@ B_bytes B_TimesD_bytesD___mul__ (B_TimesD_bytes wit, B_bytes a, B_int n) {
// Hashable


bool B_HashableD_bytesD___eq__ (B_HashableD_bytes wit, B_bytes a, B_bytes b) {
if (a->nbytes != b->nbytes)
return false;
for (int i=0; i < a->nbytes; i++)
if (a->str[i] != b->str[i])
return false;
return true;
}

bool B_HashableD_bytesD___ne__ (B_HashableD_bytes wit, B_bytes a, B_bytes b) {
return !B_HashableD_bytesD___eq__(wit,a,b);
}

B_NoneType B_HashableD_bytesD_hash(B_HashableD_bytes wit, B_bytes a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher, a);
return B_None;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/u1.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,6 @@ bool B_OrdD_u1D___ge__ (B_OrdD_u1 wit, B_u1 a, B_u1 b) {

// B_HashableD_u1 ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_u1D___eq__(B_HashableD_u1 wit, B_u1 a, B_u1 b) {
return a->val == b->val;
}

bool B_HashableD_u1D___ne__(B_HashableD_u1 wit, B_u1 a, B_u1 b) {
return a->val != b->val;
}

B_NoneType B_HashableD_u1D_hash(B_HashableD_u1 wit, B_u1 a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher,to$bytesD_len((char *)&(a->val),8));
return B_None;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/u16.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,6 @@ bool B_OrdD_u16D___ge__ (B_OrdD_u16 wit, B_u16 a, B_u16 b) {

// B_HashableD_u16 ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_u16D___eq__(B_HashableD_u16 wit, B_u16 a, B_u16 b) {
return a->val == b->val;
}

bool B_HashableD_u16D___ne__(B_HashableD_u16 wit, B_u16 a, B_u16 b) {
return a->val != b->val;
}

B_NoneType B_HashableD_u16D_hash(B_HashableD_u16 wit, B_u16 a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher,to$bytesD_len((char *)&(a->val),8));
return B_None;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/u32.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,6 @@ bool B_OrdD_u32D___ge__ (B_OrdD_u32 wit, B_u32 a, B_u32 b) {

// B_HashableD_u32 ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_u32D___eq__(B_HashableD_u32 wit, B_u32 a, B_u32 b) {
return a->val == b->val;
}

bool B_HashableD_u32D___ne__(B_HashableD_u32 wit, B_u32 a, B_u32 b) {
return a->val != b->val;
}

B_NoneType B_HashableD_u32D_hash(B_HashableD_u32 wit, B_u32 a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher,to$bytesD_len((char *)&(a->val),8));
return B_None;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/u64.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,6 @@ bool B_OrdD_u64D___ge__ (B_OrdD_u64 wit, B_u64 a, B_u64 b) {

// B_HashableD_u64 ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_u64D___eq__(B_HashableD_u64 wit, B_u64 a, B_u64 b) {
return a->val == b->val;
}

bool B_HashableD_u64D___ne__(B_HashableD_u64 wit, B_u64 a, B_u64 b) {
return a->val != b->val;
}

B_NoneType B_HashableD_u64D_hash(B_HashableD_u64 wit, B_u64 a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher,to$bytesD_len((char *)&(a->val),8));
return B_None;
Expand Down
8 changes: 0 additions & 8 deletions base/builtin/u8.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,6 @@ bool B_OrdD_u8D___ge__ (B_OrdD_u8 wit, B_u8 a, B_u8 b) {

// B_HashableD_u8 ///////////////////////////////////////////////////////////////////////////////////////////////////////

bool B_HashableD_u8D___eq__(B_HashableD_u8 wit, B_u8 a, B_u8 b) {
return a->val == b->val;
}

bool B_HashableD_u8D___ne__(B_HashableD_u8 wit, B_u8 a, B_u8 b) {
return a->val != b->val;
}

B_NoneType B_HashableD_u8D_hash(B_HashableD_u8 wit, B_u8 a, B_hasher h) {
zig_hash_wyhash_update(h->_hasher,to$bytesD_len((char *)&(a->val),8));
return B_None;
Expand Down
17 changes: 0 additions & 17 deletions base/src/__builtin__.ext.c
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
#include "rts/rts.c"

void B___ext_init__() {
/*
B_HashableD_bigintG_methods.__eq__ = (B_bool (*)(B_HashableD_bigint, B_bigint, B_bigint))B_OrdD_bigintD___eq__;
B_HashableD_intG_methods.__eq__ = (B_bool (*)(B_HashableD_int, B_int, B_int))B_OrdD_intD___eq__;
B_HashableD_i32G_methods.__eq__ = (B_bool (*)(B_HashableD_i32, B_i32, B_i32))B_OrdD_i32D___eq__;
B_HashableD_i16G_methods.__eq__ = (B_bool (*)(B_HashableD_i16, B_i16, B_i16))B_OrdD_i16D___eq__;
B_HashableD_u64G_methods.__eq__ = (B_bool (*)(B_HashableD_u64, B_u64, B_u64))B_OrdD_u64D___eq__;
B_HashableD_u32G_methods.__eq__ = (B_bool (*)(B_HashableD_u32, B_u32, B_u32))B_OrdD_u32D___eq__;
B_HashableD_u16G_methods.__eq__ = (B_bool (*)(B_HashableD_u16, B_u16, B_u16))B_OrdD_u16D___eq__;
B_HashableD_floatG_methods.__eq__ = (B_bool (*)(B_HashableD_float, B_float, B_float))B_OrdD_floatD___eq__;
B_HashableD_strG_methods.__eq__ = (B_bool (*)(B_HashableD_str, B_str, B_str))B_OrdD_strD___eq__;
B_HashableD_bytesG_methods.__eq__ = (B_bool (*)(B_HashableD_bytes, B_bytes, B_bytes))B_OrdD_bytesD___eq__;
B_HashableD_complexG_methods.__eq__ = (B_bool (*)(B_HashableD_complex, B_complex, B_complex))B_HashableD_complexD___eq__;

B_ContainerD_listG_methods.__len__ = (int64_t (*)(B_ContainerD_list, B_list))B_CollectionD_SequenceD_listD___len__;
B_ContainerD_listG_methods.__fromiter__ = (B_list (*)(B_ContainerD_list, B_Iterable, $WORD))B_CollectionD_SequenceD_listD___fromiter__;
B_ContainerD_listG_methods.__iter__ = (B_Iterator (*)(B_ContainerD_list, B_list))B_CollectionD_SequenceD_listD___iter__;
*/
}

B_str B_BaseExceptionD__name (B_BaseException self) {
Expand Down
Loading
Loading