This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
collections define: #CrossProduct &slots: {#rows -> #{}. #columns -> #{}}. | |
c@(Collection traits) <*> d@(Collection traits) | |
[ | |
CrossProduct new `>> [rows := c. columns := d. ] | |
]. | |
cross@(CrossProduct traits) do: block | |
[ | |
c do: [| :a | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ atomy git:(master) ✗ atomy | |
when loading /Users/briantrice/.rvm/gems/rbx-head/gems/atomy-0.2/kernel/boot.ay... | |
An exception occurred running /Users/briantrice/.rvm/gems/rbx-head/bin/atomy | |
undefined method `each' on nil:NilClass. (NoMethodError) | |
Backtrace: | |
Kernel(NilClass)#each (method_missing) at kernel/delta/kernel.rb:81 | |
Rubinius::AST::Container(Atomy::AST::Script)#container_bytecode at \ | |
/Users/briantrice/.rvm/rubies/rbx-head/runtime/19/compiler/ast/definitions.rbc:945 | |
Atomy::AST::Script#bytecode at /Users/briantrice/.rvm/gems/rbx-head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ atomy git:(master) ✗ atomy | |
An exception occurred running /Users/briantrice/.rvm/gems/ruby-1.9.2-p290/bin/atomy | |
undefined method `ruby19?' on Rubinius (Module) (NoMethodError) | |
Backtrace: | |
Kernel(Module)#ruby19? (method_missing) at kernel/delta/kernel.rb:79 | |
Object#__script__ at /Users/briantrice/.rvm/gems | |
/ruby-1.9.2-p290/gems | |
/atomy-0.2/bin/atomy:4 | |
Kernel(Object)#load at kernel/common/kernel.rb:732 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define: #CompactMapping &parents: {Collection. Mapping} &slots: { | |
#contents -> #{} | |
}. | |
m@(CompactMapping traits) new* | |
[| *rest | | |
m new `>> [contents := rest. ] | |
]. | |
m@(CompactMapping traits) size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Syntax | |
* DONE Bootstrap in :=. :macro:global: | |
* DONE Allow | as a binary selector character. | |
* STARTED Bootstrap in ::= binding. :macro:global: | |
* TODO Implement mutator selector pattern of "foo:=" and sunset "foo:". :global: | |
* TODO Externalize `setTo: rules into data structures. | |
* TODO Implement Ruby === for includes:/select:/case-statement usage. :vm:support: | |
With different assymetrical selector, e.g. isCaseOf:. | |
Root -> \=. Collection -> includes:, Block -> applyWith:. Regex -> matches:. | |
* TODO Implement \=:= as pattern-matching binding. :macro: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Before:" | |
r@(Range traits) hash | |
[ | |
(((r start hash bitShift: 2) | |
bitOr: r end hash) | |
bitShift: 1) | |
bitOr: r size | |
]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slate[4]> #(3 + _) `er applyTo: {4}. | |
7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define: #Particle &parents: {Mapping} &slots: {#keys -> {}. #values -> {}}. | |
p@(Particle traits) newSize: capacity | |
[ | |
p clone `>> [keys: (p keys newSize: capacity). values: (p values newSize: capacity). ] | |
]. | |
p@(Particle traits) newFrom: keys to: values | |
[ | |
p clone `>> [keys: (keys as: p keys). values: (values as: p values). ] |