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

It would be super cool if you could provide a list of line ranges for comments. Like "this comment covers lines 12-14".

I suppose if you make the refer nces fancy enough you wind up reinventing rst




This is actually really easy to do in most languages by wrapping the code you want to comment in a function.

  func uglyHackForCombiningTwoThings() {  
    // Do whatever ugly thing you want to do  
  }


You don't need a function, a simple {} block is enough if the language supports it. Some languages (ex: Python) don't have that though, you may need a function, or some other construct (ex: if true) in this case.




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

Search: