stdin input restrictions
stdin input restrictions
I need to get from input stream a lot of numbers (400+), separated by space. Testing in small amounts, manually (up to 100 numbers) - everything is ok. Coping input batch of 100 numbers to console prompt - everything is OK. But if I take 200 number (for example), it freezes and has any response. Is it some restriction on input stream?
-
- Posts: 166
- Joined: Sun Nov 28, 2010 4:21 pm
Re: stdin input restrictions
Which platform, which implementation, and some code to show what you are doing would help me help you.
Re: stdin input restrictions
yeap, of coursepjstirling wrote:Which platform, which implementation, and some code to show what you are doing would help me help you.
OSX Mojave, Implementation - SBCL 1.4.16.21-825d4d007
Sample code smtg like this
Code: Select all
(defvar *data* '())
(defun read-data()
(loop
for index from 1 to 300 do
(push (read) *data*)))
(read-data)
(format t "~%Array:~%~{~A ~}~%End array~%" *data*)
-
- Posts: 166
- Joined: Sun Nov 28, 2010 4:21 pm
Re: stdin input restrictions
If you are pasting into the terminal then you may be hitting the maximum size of the clipboard, if your code is run with stdin from a file it works-for-me![â„¢ï¸](//twemoji.maxcdn.com/2/svg/2122.svg)
But if I try to copy from an emacs buffer into the terminal then it stops at 1000127, and I assume it is hanging because it is waiting for the remaining numbers
Code: Select all
Peters-MacBook-Pro:local-projects peter$ cat /tmp/data.txt | sbcl --script test.lisp
Array:
1000299 1000298 1000297 1000296 1000295 1000294 1000293 1000292 1000291 1000290 1000289 1000288 1000287 1000286 1000285 1000284 1000283 1000282 1000281 1000280 1000279 1000278 1000277 1000276 1000275 1000274 1000273 1000272 1000271 1000270 1000269 1000268 1000267 1000266 1000265 1000264 1000263 1000262 1000261 1000260 1000259 1000258 1000257 1000256 1000255 1000254 1000253 1000252 1000251 1000250 1000249 1000248 1000247 1000246 1000245 1000244 1000243 1000242 1000241 1000240 1000239 1000238 1000237 1000236 1000235 1000234 1000233 1000232 1000231 1000230 1000229 1000228 1000227 1000226 1000225 1000224 1000223 1000222 1000221 1000220 1000219 1000218 1000217 1000216 1000215 1000214 1000213 1000212 1000211 1000210 1000209 1000208 1000207 1000206 1000205 1000204 1000203 1000202 1000201 1000200 1000199 1000198 1000197 1000196 1000195 1000194 1000193 1000192 1000191 1000190 1000189 1000188 1000187 1000186 1000185 1000184 1000183 1000182 1000181 1000180 1000179 1000178 1000177 1000176 1000175 1000174 1000173 1000172 1000171 1000170 1000169 1000168 1000167 1000166 1000165 1000164 1000163 1000162 1000161 1000160 1000159 1000158 1000157 1000156 1000155 1000154 1000153 1000152 1000151 1000150 1000149 1000148 1000147 1000146 1000145 1000144 1000143 1000142 1000141 1000140 1000139 1000138 1000137 1000136 1000135 1000134 1000133 1000132 1000131 1000130 1000129 1000128 1000127 1000126 1000125 1000124 1000123 1000122 1000121 1000120 1000119 1000118 1000117 1000116 1000115 1000114 1000113 1000112 1000111 1000110 1000109 1000108 1000107 1000106 1000105 1000104 1000103 1000102 1000101 1000100 1000099 1000098 1000097 1000096 1000095 1000094 1000093 1000092 1000091 1000090 1000089 1000088 1000087 1000086 1000085 1000084 1000083 1000082 1000081 1000080 1000079 1000078 1000077 1000076 1000075 1000074 1000073 1000072 1000071 1000070 1000069 1000068 1000067 1000066 1000065 1000064 1000063 1000062 1000061 1000060 1000059 1000058 1000057 1000056 1000055 1000054 1000053 1000052 1000051 1000050 1000049 1000048 1000047 1000046 1000045 1000044 1000043 1000042 1000041 1000040 1000039 1000038 1000037 1000036 1000035 1000034 1000033 1000032 1000031 1000030 1000029 1000028 1000027 1000026 1000025 1000024 1000023 1000022 1000021 1000020 1000019 1000018 1000017 1000016 1000015 1000014 1000013 1000012 1000011 1000010 1000009 1000008 1000007 1000006 1000005 1000004 1000003 1000002 1000001 1000000
End array