summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-04-22 13:57:20 +0200
committerAraq <rumpf_a@web.de>2015-04-22 13:57:20 +0200
commitd631958124e08723738886946d6fe82f0a6ade2d (patch)
treed0301335ab1240ca30f1e01af377e7d07ea23777
parent8ab3074c80c6509b22ccdf47cd2abfad7436a0f8 (diff)
downloadNim-d631958124e08723738886946d6fe82f0a6ade2d.tar.gz
news.txt updates; fixes bootstrapping
-rw-r--r--lib/system.nim5
-rw-r--r--web/news.txt5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 3e8c17324..1805dd813 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -3266,9 +3266,10 @@ template `..<`*(a, b: expr): expr =
   ## '..' and '<' is required.
   a .. <b
 
-proc xlen*(x: string): int {.magic: "XLenStr", noSideEffect.}
-proc xlen*[T](x: seq[T]): int {.magic: "XLenSeq", noSideEffect.}
+proc xlen*(x: string): int {.magic: "XLenStr", noSideEffect.} = discard
+proc xlen*[T](x: seq[T]): int {.magic: "XLenSeq", noSideEffect.} =
   ## returns the length of a sequence or a string without testing for 'nil'.
   ## This is an optimization that rarely makes sense.
+  discard
 
 {.pop.} #{.push warning[GcMem]: off.}
diff --git a/web/news.txt b/web/news.txt
index 6b109aa1c..257591de7 100644
--- a/web/news.txt
+++ b/web/news.txt
@@ -127,6 +127,7 @@ News
     things from backwards: ``a[^1]`` is like Python's ``a[-1]``.
   - A first version of the specification and implementation of the overloading
     of the assignment operator has arrived!
+  - ``system.len`` for strings and sequences now returns 0 for nil.
 
 
   Library additions
@@ -137,6 +138,10 @@ News
     with a ``newMultipartData`` proc.
   - Added `%*` operator for JSON.
   - The compiler is now available as Nimble package for c2nim.
+  - Added ``..^`` and ``..<`` templates to system so that the rather annoying
+    space between ``.. <`` and ``.. ^`` is not necessary anymore.
+  - Added ``system.xlen`` for strings and sequences to get back the old ``len``
+    operation that doesn't check for ``nil`` for efficiency.
 
 
   Bugfixes
n192' href='#n192'>192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314