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

They probably refer to how it has the top-level as

  <line-condition> { <code> }
That's unusual enough among programming languages to call it odd. Being able to do stuff like

  if (/some-pattern/) { ...
and have the regex be evaluated like a condition where it matches with the current line implicitly is also pretty unique.



  if (/some-pattern/) { ...
This isn't really unique when you consider perl.

  while (<>) {
    if (/pattern/) {
This does the same. Awk simply has the implicit loop.


Yes, I think Perl based that on Awk, but then those are the only 2 languages I know that support something like that. That's still very unique. On the implicit loop, along with Ruby, they're the only 3 languages I know that support something like that. That's also pretty unique, and Awk is the only one that has the implicit loop as a requirement.


The implicit loop is uncommon among general-purpose langauges, but very common among filtering-centric languages like awk and grep and sed. For a more recent example, see jq. perl 5 may be close to the only mainstream general-purpose language to have embraced that paradigm though.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: