<commit_before>#!/usr/bin/ruby
#
# This file contains the class definition for MUES::Metaclass::Class, which is a
# metaclass used to build class definitions.
#
# == Synopsis
#
#	require 'mues/Metaclasses'
#	include MUES
#
#	myClass = Metaclass::Class.new( "MyClass" )
#
#	myClass << Metaclass::Attribute.new( "name", Metaclass::Scope::INSTANCE ) << 
#		Metaclass::Attribute.new( "size", Metaclass::Scope::CLASS )
#
#	myClass << Metaclass::Operation.new( "initialize", <<-'EOM' )
#			@name = name
#			@@size += 1
#		EOM 
#	myClass.operations['initialize'].addArgument( :name, String )
#
#	myClass << Metaclass::Operation.new( "to_s", <<-'EOM' )
#		return "#{@name} (size #{@@size})"
#	EOM
#
#	eval myClass.classDefinition
#
#	myInstance = MyClass.new( "a name" )
#	puts myInstance.to_s
#
# == Rcsid
# 
# $Id: class.rb,v 1.14 2002/10/04 11:00:41 deveiant Exp $
# 
# == Authors
# 
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# 
#:include: COPYRIGHT
#
#---
#
# Please see the file COPYRIGHT for licensing details.
#

require 'mues/metaclass/Constants'
require 'mues/metaclass/Attribute'
require 'mues/metaclass/Operation'
require 'mues/metaclass/Interface'


module MUES
	module Metaclass

		### An exception for indicating a problem in a Class metaclass object.
		class ClassException < ScriptError; end


		### A "Class" metaclass. Instances of this class are objects which can be used
		### to build other classes.
		class Class

			Version = /([\d\.]+)/.match( %q{$Revision: 1.14 $} )[1]
			Rcsid = %q$Id: class.rb,v 1.14 2002/10/04 11:00:41 deveiant Exp $

			# Mix in comparison methods
			include Comparable

			# Mix in instance vars, accessors, and methods for associated classes
			include MUES::Metaclass::Attribute::Methods
			include MUES::Metaclass::Operation::Methods
			include MUES::Metaclass::Interface::Methods


			### Create and return a new Class metaclass object with the specified
			### +name+, and optional +superclass+.
			def initialize( name, superclass=nil )
				raise ArgumentError,
					"Superclass must be a Class or a Metaclass::Class." unless
					superclass.nil? || superclass.kind_of?( ::Class ) ||
					superclass.kind_of?( Metaclass::Class )

				# If the BaseClass class isn't loaded yet, load it
				unless Metaclass.const_defined? :BaseClass
					require 'mues/metaclass/BaseClass'
				end

				@name		= name
				@superclass	= superclass || Metaclass::BaseClass::instance
				@classObj	= nil

				# Initialize attributes, operations, and interface instance vars
				super()
			end

			
			######
			public<commit_msg>- Converted to use MUES's type-checking.<commit_after>#!/usr/bin/ruby
#
# This file contains the class definition for MUES::Metaclass::Class, which is a
# metaclass used to build class definitions.
#
# == Synopsis
#
#	require 'mues/Metaclasses'
#	include MUES
#
#	myClass = Metaclass::Class.new( "MyClass" )
#
#	myClass << Metaclass::Attribute.new( "name", Metaclass::Scope::INSTANCE ) << 
#		Metaclass::Attribute.new( "size", Metaclass::Scope::CLASS )
#
#	myClass << Metaclass::Operation.new( "initialize", <<-'EOM' )
#			@name = name
#			@@size += 1
#		EOM 
#	myClass.operations['initialize'].addArgument( :name, String )
#
#	myClass << Metaclass::Operation.new( "to_s", <<-'EOM' )
#		return "#{@name} (size #{@@size})"
#	EOM
#
#	eval myClass.classDefinition
#
#	myInstance = MyClass.new( "a name" )
#	puts myInstance.to_s
#
# == Rcsid
# 
# $Id: class.rb,v 1.15 2002/10/04 11:04:10 deveiant Exp $
# 
# == Authors
# 
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# 
#:include: COPYRIGHT
#
#---
#
# Please see the file COPYRIGHT for licensing details.
#

require 'mues/Mixins'

require 'mues/metaclass/Constants'
require 'mues/metaclass/Attribute'
require 'mues/metaclass/Operation'
require 'mues/metaclass/Interface'


module MUES
	module Metaclass

		### An exception for indicating a problem in a Class metaclass object.
		class ClassException < ScriptError; end


		### A "Class" metaclass. Instances of this class are objects which can be used
		### to build other classes.
		class Class

			Version = /([\d\.]+)/.match( %q{$Revision: 1.15 $} )[1]
			Rcsid = %q$Id: class.rb,v 1.15 2002/10/04 11:04:10 deveiant Exp $

			# Mix in comparison methods
			include Comparable

			# Mix in type-checking functions
			include MUES::TypeCheckFunctions

			# Mix in instance vars, accessors, and methods for associated classes
			include MUES::Metaclass::Attribute::Methods
			include MUES::Metaclass::Operation::Methods
			include MUES::Metaclass::Interface::Methods


			### Create and return a new Class metaclass object with the specified
			### +name+, and optional +superclass+.
			def initialize( name, superclass=nil )
				checkType( superclass, NilClass, ::Class, Metaclass::Class )

				# If the BaseClass class isn't loaded yet, load it
				unless Metaclass.const_defined? :BaseClass
					require 'mues/metaclass/BaseClass'
				end

				@name		= name
				@superclass	= superclass || Metaclass::BaseClass::instance
				@classObj	= nil

				# Initialize attributes, operations, and interface instance vars
				super()
			end

			
			######
			public
{'fraction_non_alphanumeric': 0.14106583072100312, 'fraction_numerical': 0.015282131661442006, 'mean_word_length': 3.9611273080660836, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 15, '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': '2049184', 'n_tokens_mistral': 1978, 'n_tokens_neox': 1715, 'n_words': 467}