Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't understand, this gives C style for loops with C syntax?


This adds c style for loops to hy, which runs on the normal cpython vm, and therefore can make use of the thousands of open source python libraries available.

My reply to the post was tongue in cheek. The point is that you can add on arbitrary language features to python using hy (any lisp, really). The syntax in question is normally referred to as an s-expression.


looks like it to me

  cfor(setv(i, 0), i < 10, i += 1) {
    print(i)   
  }


Do the brackets actually work or do you still have to get the indentation right?


no, just saying you can trivially convert any lisp code to c style syntax by moving the function call parenthesis to the right and converting wrapping parens into curly braces.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: