-
Notifications
You must be signed in to change notification settings - Fork 21
scala compile fails on simple but lengthy repetitive script (ClassNotFound and/or StackOverflowError) #6543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6543?orig=1
|
@paulp said: |
@paulp said:
|
Phil Walker (philwalk9) said (edited on Oct 19, 2012 4:35:58 PM UTC): |
Phil Walker (philwalk9) said (edited on Oct 19, 2012 4:31:11 PM UTC): I have been using scala (quite successfully, thank you) as my primary scripting language for the last 2 years.
Both of these features are necessary for a scala script (and/or equivalent executable jar file) to be distributed as a single file, placed anywhere in the filesystem, and executed without a wrapper (e.g., a bash script). The failing script referred to here was generated via the command line 'find tmp -type f | xargs cksum > listItems.sc', after which I intended to quickly convert the output to a script that permits duplicate files (those with equal cksum in column 1) to be reported. Due to the length of the list and the foldRight limitation, I haven't figured out how I might resolve this (without resorting to ruby). Feature #2 is a trivial operation in mainstream scripting languages, and although it is possible in scala, the solution is quite ugly: see 'showScript.sc', attached). |
Phil Walker (philwalk9) said: val list = """ """.trim.split("""[\r\n]+""".toList I wasn't surprised that it didn't succeed (due to similar failed past attempts), but the error I expected was a "maximum String length exceeded", or similar. java.lang.ClassFormatError: Unknown constant tag 47 in class file Main$$anon$1 |
Phil Walker (philwalk9) said: |
BitMagier (bitmagier) said: object ChiSquareAlpha
{
val ChiSquareToAlphaIndexTable = Map(
1 -> Array(0.00016,0.00063,0.00393,0.01579,0.06418,0.14847,0.45494,1.07419,1.64237,2.70554,3.84146,5.41189,6.63490,10.82757),
.. 9998 other entries ..
10000 -> Array(9673.95,9711.71,9768.53,9819.19,9880.79,9925.36,9999.33,10073.68,10118.82,10181.66,10233.75,10292.58,10331.93,10442.73)
)
def main(args: Array[String]): Unit = {
println(ChiSquareToAlphaIndexTable(9999)(0))
}
} With Scala 2.10 (target jvm-1.6) and oracle-jre-bin-1.7.0.21 (same result with jre-1.6.0.45) under 64 Bit Linux:
I'll attach source file ChiSquareAlpha.scala to reproduce it. |
comment/reopen if this still happens with current Scala |
attached script fails, failure mode depends on scala version:
The text was updated successfully, but these errors were encountered: