Comments (3)
I dont know but converting the experssion to string
and back it again to NimNode
fixes the problem:
macro iterrr*(a, body): untyped =
let itrbl = a.repr.parseExpr
# rest of the codes ...
from iterrr.
converting the experssion to
string
and back it again toNimNode
fixes the problem
doing this removes compiler information about the context of the code, and it prevents some odd bugs (case2 worked find but case 1 had some unexpected compile-time code expandation! )
let r1 = iterrr i.splitLines:
map it.split '-'
map it.items |> toseq() # case 1
# map it.items.iterrr do: # case 2
# toseq()
count()
UPDATE: No, I was wrong,
from iterrr.
using not overloaded function fixes the probllem somehow:
func splitFn(s: string, c: char): seq[string] =
s.split c
let r1 = iterrr i.splitLines:
map it.splitfn '-'
map it.items |> toseq() # case 1
# map it.items.iterrr do: # case 2
# toseq()
count()
from iterrr.
Related Issues (20)
- add custom reducer
- Add `isum`
- Add inplace reducer
- Optimize `replacedIdent`
- add support for more syntax flexibility HOT 2
- Add non operator version
- Add `ifor`
- replace `><` with `|>`
- add another syntax for custom idents
- custom adapter HOT 11
- Add doc for adapters
- problem with nested calls HOT 1
- nested call variable shadowing HOT 3
- `acc` name collision
- make it simple, make it usable
- remove unncessary `untyped` from template args in generated code
- Replace `with` by `inject`
- add `define` HOT 1
- `iterrr` macro removed. HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iterrr.