diff --git a/lib/array.fy b/lib/array.fy index 703ba726..e2a85153 100644 --- a/lib/array.fy +++ b/lib/array.fy @@ -4,28 +4,28 @@ class Array { Arrays are dynamically resizable containers with a constant-time index-based access to members. """ - + include: Fancy Enumerable - + # Late-documentation of Rbx-methods. # lib/rbx/array.fy#L66 method_documentation: <[ 'at: => """ @idx Index for value to retrieve. @return Value with the given index (if available), or @nil. - + Returns the element in the @Array@ at a given index. """, - + '[]: => """ @idx Index to set a value for. @obj Value (object) to be set at the given index. @return @obj. - + Inserts a given object at a given index (position) in the Array. """ ]> - + def Array new: size { """ @size Initial size of the @Array@ to be created (values default to @nil). diff --git a/lib/object.fy b/lib/object.fy index 0925f280..f314c977 100644 --- a/lib/object.fy +++ b/lib/object.fy @@ -3,7 +3,7 @@ class Object { Root class of Fancy's class hierarchy. All classes inherit from Object. """ - + # Late-documentation of Rbx-methods. # lib/rbx/object.fy#L82 method_documentation: <[ @@ -13,16 +13,16 @@ class Object { Indicates, if an object is an instance of a given Class. """, - + 'kind_of?: => """ @class @Class@ to check for if @self is an instance of. @return @true if @self is an instance of @class, @false otherwise. - + Same as Object#is_a?: Indicates, if an object is an instance of a given Class. """ ]> - + def ++ other { """ @other Other object to concatenate its @String value with. diff --git a/lib/rbx/array.fy b/lib/rbx/array.fy index 4756f2c0..66ad9b6f 100644 --- a/lib/rbx/array.fy +++ b/lib/rbx/array.fy @@ -62,11 +62,11 @@ class Array { } nil } - + # Late-documented in lib/array.fy#L10 alias_method: 'at: for: 'at alias_method: '[]: for_ruby: '[]= - + alias_method: 'at:put: for: '[]: alias_method('at_put, '[]=) diff --git a/lib/rbx/class.fy b/lib/rbx/class.fy index 67a92feb..97db3978 100644 --- a/lib/rbx/class.fy +++ b/lib/rbx/class.fy @@ -264,7 +264,7 @@ class Class { case _ -> alias_method(ruby_method_name, method_name message_name) } } - + def method_documentation: documentation_hash { """ @documentation_hash @Hash@ of method name to documentation string. @@ -286,12 +286,12 @@ class Class { instance_method: method_name . documentation: doc } } - + def method: method_name doc: doc_string { """ @method_name Name of method to set documentation string for. @doc Documentation string. - + Sets the documentation string @doc for the method @method_name. """ instance_method: method_name . documentation: doc_string diff --git a/tools/benchmarks/fasta2.fy b/tools/benchmarks/fasta2.fy index 00cb4121..bef2f1f4 100644 --- a/tools/benchmarks/fasta2.fy +++ b/tools/benchmarks/fasta2.fy @@ -90,10 +90,10 @@ def fasta_repeat: n seq: seq { def fasta_random: count genelist: list { _stdout = *stdout* - + #buff = Array new: WIDTH make_cumulative: list - + while: { count > 0 } do: { buff = StringIO new line = WIDTH min: count @@ -102,7 +102,7 @@ def fasta_random: count genelist: list { while: { pos < line } do: { Last = (Last * A + C) % M r = (Last to_f) / M - + i = 0 # Linear search while: { (list[i] p) < r } do: {