Error in (replace)?

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
alex
Posts: 100
Joined: Thu Mar 10, 2005 2:27 pm
Location: Russia

Error in (replace)?

Post by alex »

Code: Select all

Microsoft Windows XP [Версия 5.1.2600]
(С) Корпорация Майкрософт, 1985-2001.

c:\newlisp>newlisp
newLISP v.8.7.10 on Win32 MinGW, execute 'newlisp -h' for more info.

>  (replace "(.{1})" (dup "0" 500)  "1" 0)
"1111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111"
>  (replace "(.{1})" (dup "0" 500000000)  "1" 0)

c:\newlisp>

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

This is a problem of memory management in MS Windows. (dup "0" 500000000) will try to allocate a huge amount of memory.

A UNIX system will start swapping and perhaps run out of memory.

Lutz

alex
Posts: 100
Joined: Thu Mar 10, 2005 2:27 pm
Location: Russia

Post by alex »

Thanks.
It is bad "new" for me :-(

Locked