Commit Graph
12 Commits
Author SHA1 Message Date
Kyle Marek-Spartz e9391313b7 style: remove space before parentheses in map and where method definitions in core.wren and generated wren_core.c 2014-02-18 17:54:55 +00:00
Kyle Marek-Spartz ea57beeabc docs: swap title and site name order in HTML template for better tab readability 2014-02-17 04:02:04 +00:00
Kyle Marek-Spartz 6cfb8b1551 test: merge custom bitwise operator tests into existing operators test file 2014-02-17 01:42:49 +00:00
Kyle Marek-Spartz 59ce704a53 style: convert dart code block indentation from 4 to 2 spaces in variables.markdown doc 2014-02-17 01:27:11 +00:00
Kyle Marek-Spartz 4f4251882d feat: enable custom bitwise operators | and & in wren compiler and add test
Add INFIX_OPERATOR entries for TOKEN_PIPE and TOKEN_AMP with PREC_BITWISE precedence in the compiler's grammar rules, replacing the previous UNUSED entries. This allows user-defined classes to implement custom `|` and `&` operator methods.

Include a new test file `test/custom_operators/bitwise.wren` that defines Amp and Pipe classes with their respective operator methods to validate the feature works correctly.
2014-02-16 18:01:40 +00:00
Kyle Marek-Spartz 3b9478908f docs: update documentation examples to use uppercase IO instead of lowercase io 2014-02-16 17:28:56 +00:00
Kyle Marek-Spartz 5ccf0546c1 fix: correct spelling of "rivaling" and "carnival" in performance documentation
Fix two typos in doc/site/performance.markdown: change "rivalling" to "rivaling" in the paragraph about language implementation complexity, and change "carvinal" to "carnival" in the benchmarks section.
2014-02-15 23:12:18 +00:00
Kyle Marek-Spartz 35fbcc5b49 feat: add List.where method for filtering elements with predicate function
Implement a `where` method on the List class that takes a predicate function and returns a new list containing only elements for which the predicate returns true. The implementation iterates over the list, calls the predicate on each element, and collects matching elements into a new list. Includes test cases verifying filtering with both matching and non-matching predicates.
2014-02-15 06:42:14 +00:00
Kyle Marek-Spartz edaf529598 chore: replace IO.write with IO.print and fix array spacing in map test
- Change IO.write to IO.print for output consistency in map.wren test
- Add spaces after commas in array literal [1, 2, 3] to match style guide
2014-02-15 06:34:30 +00:00
Kyle Marek-Spartz 632cbf31b7 fix: correct typo in comment and remove redundant struct tag in Token definition 2014-02-15 06:15:51 +00:00
Kyle Marek-Spartz 48ef257973 feat: add List.map method with test for element transformation
Implement a `map` method on the List class that applies a given function `f` to each element, returning a new list with the transformed values. Includes a test case verifying incrementing each element by 1.
2014-02-15 05:06:29 +00:00
Kyle Marek-Spartz e690a48e45 feat: implement List concat operator + supporting Range and empty lists
Add `+` method to List class in core.wren that creates a new list by concatenating elements from both operands. Supports concatenation with Range objects and handles empty lists on either side. Includes comprehensive test cases in test/list/concat.wren covering list-list, list-range, and empty list combinations.
2014-02-14 17:09:02 +00:00