?

Log in

No account? Create an account

Previous Entry | Next Entry

a trivial note on block structure

Having written a bunch of Python and Ocaml recently... I find I miss the {} blocks of C and Perl; they make it a lot easier (given vi's % key) to jump between the beginning and end of a code block, and to be sure that a code block *is* a code block. To be fair, Ocaml doesn't mind if you drop extra parentheses around things, and views them as equivalent to 'begin...end' which is apparently more idiomatic for when you need block markers... but my editor doesn't bounce between begin and end.

I guess the other idiom is "write short functions that fit on a page", but that doesn't always work, especially if writing a bunch of specialized utility functions nested within a bigger function.

Edit: new discovery! vim highlights unmatched 'end' keywords in Ocaml files! That's neat. Still can't bounce between begin and end, though.

Also: ocaml's "Syntax error" is profoundly unhelpful.

See the comment count unavailable DW comments at http://mindstalk.dreamwidth.org/459523.html#comments

Profile

Phoenix
mindstalk
Damien Sullivan
Website

Latest Month

November 2017
S M T W T F S
   1234
567891011
12131415161718
19202122232425
2627282930  

Tags

Powered by LiveJournal.com
Designed by Lilia Ahner