Re: Errors running script

new topic     » goto parent     » topic index » view thread      » older message » newer message
lib9 said...

Hi,

Please, consider this code:

-- Euphoria Code   
atom t0   
t0 = time() 
  
integer n = 10 
sequence b_lst = repeat( 1, n )   
sequence prime_lst = {}   
   
for prime = 2 to n do   
	if b_lst[prime] then   
		prime_lst = append(prime_lst, prime )   
		for i = prime * 2  to n by prime do   
			b_lst[i] = 0   
		end for   
	end if   
end for   
   
? prime_lst[$-9..$]   
? time() - t0  

When I try to run it, it returns two errors.

$ exu eratosthenes.eu  
ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. 
eratosthenes.eu:5 
unknown command 
integer n = 10 
          ^ 
 
Press Enter 

I'm using version 3.1.1. The first error is ignored, seems a missing dependency.

Why is there an error in the line?

integer n = 10 

Hi if you are using Eu 3.1.1 then you cannot assign a variable at declaration, but if you are using Eu 4.x hen you can.

So in Eu 3, integer n = 10 is illegal but in eu 4 integer n = 10 is legal.

Just wanted to clarify that a bit.

Incidentally, why are you using Eu 3.1.1?

Cheers

Chris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu