Commit Graph
11 Commits
Author SHA1 Message Date
Luchs 205bf6d596 refactor: rename static callFunction helper to callFn to avoid name collision with public API
The static helper `callFunction` in wren_core.c was renamed to `callFn` to prevent symbol conflicts with the public `wrenCallFunction` API, ensuring unique linkage and clearer separation between internal and external call paths.
2015-03-26 19:42:20 +00:00
Luchs a56c277473 fix: correct broken link to wren.h in embedding-api documentation
The link previously pointed to the old include/wren.h path but the file was moved to src/include/wren.h. Updated the URL in doc/site/embedding-api.markdown to reflect the new location.
2015-04-03 22:51:42 +00:00
Luchs 3373ae0296 fix: cast subtraction to int before abs to suppress clang 3.5 -Wabsolute-value warning 2015-04-01 15:42:20 +00:00
Luchs a1fa51459d docs: correct reduce documentation to state it works on non-empty lists instead of requiring two or more elements 2015-01-16 08:53:20 +00:00
Luchs 6530926aab docs: add Lukas Werling to AUTHORS file
Add Lukas Werling's name and email address to the project's AUTHORS file,
inserting the new entry after the existing contributor Gavin Schulz.
2015-01-16 08:53:14 +00:00
Luchs 6ac4e99b55 test: add string concatenation test for reduce with folding order
Add test cases demonstrating that the reduce function works with string arrays
and concatenation, verifying both with and without initial accumulator values.
The test uses a list of characters ["W", "o", "r", "l", "d"] and the existing
sum function to show that reduce correctly folds strings in order.
2015-01-16 08:48:59 +00:00
Luchs b25c181b7b feat: add reduce test for range covering sum and min with initial value
Add a new test file `test/range/reduce.wren` that validates the `reduce` method on numeric ranges. The test exercises two cases: summing integers 1 through 10 (expecting 55) and finding the minimum value with an initial accumulator of 100 (expecting 1).
2015-01-16 08:33:23 +00:00
Luchs a05dc9d733 feat: add test for reduce on empty list expecting runtime error 2015-01-16 08:29:45 +00:00
Luchs fb14301967 feat: implement single-argument reduce with manual iteration and empty-sequence abort
Replace the previous slice-based single-argument reduce implementation with an explicit iterator loop that seeds from the first element. This avoids the out-of-bounds range error on single-element lists and adds a Fiber.abort for empty sequences. Update the test to verify correct behavior for single-element and empty sequences.
2015-01-16 08:24:18 +00:00
Luchs 6cc513f13c docs: add documentation for reduce function variants in core-library 2015-01-15 15:38:11 +00:00
Luchs afa0a0a8e9 feat: add reduce method to Sequence with two overloads and tests
Implement `reduce` on the `Sequence` class in core.wren with two overloads: one taking an initial accumulator and a function, and another using the first element as the initial accumulator. Add three test files covering normal reduction, single-element edge case, and wrong arity error.
2015-01-15 15:29:49 +00:00