You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
main ->
print(filter(divBy2, [1..20]))
where
divBy2: @(n) -> {(n % 2) == 0}
This causes an infinite loop and eventually a stack overflow in the code generator:
Exception in thread "main" java.lang.StackOverflowError
at java.util.regex.Pattern.append(Unknown Source)
at java.util.regex.Pattern.atom(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.lang.String.replaceFirst(Unknown Source)
at loop.AsmCodeEmitter.normalizeMethodName(AsmCodeEmitter.java:720)
at loop.AsmCodeEmitter.access$500(AsmCodeEmitter.java:68)
at loop.AsmCodeEmitter$18.emitCode(AsmCodeEmitter.java:971)
at loop.AsmCodeEmitter.emit(AsmCodeEmitter.java:235)
at loop.AsmCodeEmitter$6.emitCode(AsmCodeEmitter.java:649)
at loop.AsmCodeEmitter.emit(AsmCodeEmitter.java:235)
at loop.AsmCodeEmitter$18.emitCode(AsmCodeEmitter.java:1001)
at loop.AsmCodeEmitter.emit(AsmCodeEmitter.java:235)
at loop.AsmCodeEmitter$6.emitCode(AsmCodeEmitter.java:649)
etc.
Where as:
main ->
print(filter( @(n) -> {(n % 2) == 0} , [1..20]))
works great. So does:
main ->
print(filter(divBy2, [1..20]))
where
divBy2(n) ->
(n % 2) == 0
The text was updated successfully, but these errors were encountered:
filter(criteria, ls) =>
*, [] : []
*, [x:xs] | criteria.@call(x) : [x] + filter(criteria,xs)
| else : filter(criteria, xs)
main ->
print(filter(divBy2, [1..20]))
where
divBy2: @(n) -> {(n % 2) == 0}
This causes an infinite loop and eventually a stack overflow in the code generator:
Exception in thread "main" java.lang.StackOverflowError
at java.util.regex.Pattern.append(Unknown Source)
at java.util.regex.Pattern.atom(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.lang.String.replaceFirst(Unknown Source)
at loop.AsmCodeEmitter.normalizeMethodName(AsmCodeEmitter.java:720)
at loop.AsmCodeEmitter.access$500(AsmCodeEmitter.java:68)
at loop.AsmCodeEmitter$18.emitCode(AsmCodeEmitter.java:971)
at loop.AsmCodeEmitter.emit(AsmCodeEmitter.java:235)
at loop.AsmCodeEmitter$6.emitCode(AsmCodeEmitter.java:649)
at loop.AsmCodeEmitter.emit(AsmCodeEmitter.java:235)
at loop.AsmCodeEmitter$18.emitCode(AsmCodeEmitter.java:1001)
at loop.AsmCodeEmitter.emit(AsmCodeEmitter.java:235)
at loop.AsmCodeEmitter$6.emitCode(AsmCodeEmitter.java:649)
etc.
Where as:
main ->
print(filter( @(n) -> {(n % 2) == 0} , [1..20]))
works great. So does:
main ->
print(filter(divBy2, [1..20]))
where
divBy2(n) ->
(n % 2) == 0
The text was updated successfully, but these errors were encountered: