Error in (replace)?

Started by alex, July 19, 2006, 12:57:32 PM

Previous topic - Next topic

alex

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

#1
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

#2
Thanks.

It is bad "new" for me :-(