<commit_before>//  Copyright (c) 2014 <NAME>. All rights reserved.

/// Boxes \c value up for use in recursive structs/enums or parameterized classes.
///
/// This is a currently-required implementation detail to handle the compiler’s lack of codegen for recursive enum/struct definitions, and classes with non-fixed layout.
func box<T>(value: T) -> Box<T> {
	return Box(value)
}

/// A box for a value which would otherwise cause compiler issues: recursive enum/struct definitions, and classes with non-fixed layout.
@final class Box<T> {
	let _value: [T]
	
	var value: T { return _value[0] }
	
	init(_ value: T) {
		_value = [ value ]
	}
	
	@conversion func __conversion() -> T {
		return value
	}
}


extension Box : Identifiable {
	var identity: ObjectIdentifier { return reflect(self).objectIdentifier! }
}


func == <Boxed : Equatable>(a: Box<Boxed>, b: Box<Boxed>) -> Bool {
	return a.value == b.value
}


func hash<Boxed : Hashable>(box: Box<Boxed>) -> Int {
	return box.value.hashValue
}


func toString<T>(box: Box<T>) -> String {
	return toString(box.value)
}<commit_msg>Non-final classes can have non-fixed layout now.<commit_after>//  Copyright (c) 2014 <NAME>. All rights reserved.

/// Boxes \c value up for use in recursive structs/enums or parameterized classes.
///
/// This is a currently-required implementation detail to handle the compiler’s lack of codegen for recursive enum/struct definitions, and classes with non-fixed layout.
func box<T>(value: T) -> Box<T> {
	return Box(value)
}

/// A box for a value which would otherwise cause compiler issues: recursive enum/struct definitions, and classes with non-fixed layout.
class Box<T> {
	let value: T
	
	init(_ value: T) {
		self.value = value
	}
	
	@conversion func __conversion() -> T {
		return value
	}
}


extension Box : Identifiable {
	var identity: ObjectIdentifier { return reflect(self).objectIdentifier! }
}


func == <Boxed : Equatable>(a: Box<Boxed>, b: Box<Boxed>) -> Bool {
	return a.value == b.value
}


func hash<Boxed : Hashable>(box: Box<Boxed>) -> Int {
	return box.value.hashValue
}


func toString<T>(box: Box<T>) -> String {
	return toString(box.value)
}
{'fraction_non_alphanumeric': 0.12546468401486988, 'fraction_numerical': 0.004182156133828996, 'mean_word_length': 3.8058035714285716, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7009695', 'n_tokens_mistral': 701, 'n_tokens_neox': 661, 'n_words': 240}