Hacker News new | past | comments | ask | show | jobs | submit login

Why index from 1 or 0 when you can overwrite $[ in perl and index from ANYWHERE?

(Dammit, as of Perl 5.16 this is not merely deprecated but outsourced to a module ... mutter, grumble)




IIRC Fortran also allows you do to do this.

Another would be Rebol:

  >> a: [0 1 2 3 4 5]
  == [0 1 2 3 4 5]
  
  >> a/1
  == 0
  
  >> a/2
  == 1
  
  >> a: next a
  == [1 2 3 4 5]
  
  >> a/1
  == 1
  
  >> a/2
  == 2
  
  >> a/0
  == 0




Registration is open for Startup School 2019. Classes start July 22nd.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: