-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement the
map
function, add a test for lambda
- Loading branch information
Showing
4 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
+package preface | ||
+alias return preface.return | ||
+alias xmyArray preface.xmyArray | ||
|
||
[] > xmap | ||
[f l] > apply | ||
[stackUp] > @ | ||
(goto ((xmyArray.apply (*)).@)).result > ans | ||
memory 0 > i | ||
seq > @ | ||
(i.lt (l.value.length)).while | ||
[unused] | ||
(goto ((f.apply (l.value.get i)).@)).result > to-append | ||
seq > @ | ||
(goto ((ans.xappend.apply ans to-append).@)).result | ||
i.write (i.plus 1) | ||
123 | ||
stackUp.forward (return ans) | ||
123 | ||
|
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
...test/resources/org/polystat/py2eo/transpiler/simple-tests/expressions/lambda/lambda3.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
enabled: False | ||
enabled: True | ||
python: | | ||
def lambda1(): | ||
my_list = [1, 5, 4, 6, 8, 11, 3, 12] | ||
|
1415be1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to retrieve PDD puzzles from the code base and submit them to github. If you think that it's a bug on our side, please submit it to yegor256/0pdd:
Please, copy and paste this stack trace to GitHub: