5 ms·
I'm a fan of python myself, but what does 'off-side rule' mean?
by m_mueller 12y ago
I'm a fan of python myself, but what does 'off-side rule' mean?
- seanmcdirmid 12y agoI'm on mobile, so can't easily find a link. But its basically the term landen used to describe using indentation to delimit block structure. There is a wiki page on it.
- m_mueller 12y agoOk, I figured as much. I've only ever seen 'significant whitespace' to describe this, but I guess that's not very clear either. I myself do like it as well, I just wish tabs were the default for indenting in editors and general best practices instead of spaces.
- seanmcdirmid 12y agoI'm a big believer in amped up language specific editors to deal with that (http://research.microsoft.com/en-us/projects/liveprogramming/typography.aspx http://research.microsoft.com/en-us/projects/liveprogramming...).
- gnufx 12y agohttp://dl.acm.org/citation.cfm?doid=365230.365257 http://dl.acm.org/citation.cfm?doid=365230.365257 and gratis copies elsewhere; required reading since 1966. Of course "off-side" is a football term, somewhat significant in England later that year. However, Python doesn't use Landin's off-side rule; colons are required, c.f. Haskell's usual syntax. Emacs works anyhow.
- seanmcdirmid 12y agoI prefer Python's use of colons to haskell's nothingness. Now...that means colons can't be used for types or cons, but it makes a lot of sense for python.
- deleted 12y ago[deleted]