fold

F# - Breaking a List into Concatenated Strings by an Interval

I have a list of email addresses, and I need to send an email notification to each address. I'd like to do this in blocks of 25 addresses at a time. Is there any quick way in a functional language like F# to "fold" (concatenate) 25 emails addresses together... each separated by a semicolon. I know there is the String.Split method in .NET...

How can I automatically fold a long C code in Vim?

I regularly run into C-codes without folding. It is irritating to read them if there is no folding, particularly with long files. How can I fold them? ...

Unable to edit a title without opening a fold in Vim

Let's assume you have a cursor at a closed fold as in the picture. How can you edit the title of SMALLAPPS without opening the fold in Vim? ...

Folding away assertions in C++ class?

So, in a non-class type of situation, I can do something like this: int val_to_check = 0; int some_func(int param) { assert(val_to_check == 0); return param*param+param; } int main() { printf("Val: %i\n", some_func(rand())); return 0; } If val_to_check is declared const instead, the assertion can be folded away by the compil...

"unfold" for common lisp?

I learned quite a bit of scheme from SICP but am more interested in common lisp now. I know common lisp's fold is reduce, with special arguments for left or right folding, but what is the equivalent of unfold? Googling has not helped much. In fact I get the impression there is no unfold??? ...

Code folding is not saved in my vimrc

I added the following code to my .vimrc: " save and restore folds when a file is closed and re-opened autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent loadview HTML and CSS documents save and restore their folds but code folding is not being saved in my .vimrc Any suggestions? EDIT: The following code solves the probl...

What's your favorite folding method (or secret techique) in Vim for HTML, Javascript and CSS?

I use something like this: 1,40 fo but I think is not the most efficient way. What's yours? ...

How can I use Vim syntax files to collapse single line comments into one region?

I'm putting together a syntax for editing Java Manifest files (at github, if anyone's interested). I'm trying to collapse multiple single-line-comments (which I'm matching at the moment with syntax match manifestComment "#.*"). However, if I try to use a syntax region, then the entire file is marked and the entire thing collapses. What ...

functional programming scala map and fold left

Hi can someone tell me some good tutorials on fold left and map ...

How do you solve this Haskell problem using higher order functions?

Using higher order functions (map, fold or filter) and if necessary lambda expressions. Write a definition for f1 and f2 so the following evaluation is valid: f1 (f2 (*) [1,2,3,4]) 5 == [5,10,15,20] Any help would be appreciated, thanks. ...

Can I and How to disable the popup when mouse hover/over the "plus(+)" mark in Eclipse?

When I use Eclipse to code Java programs, I can fold a block of codes, for example: a method or a comment. And When I fold the block, there will be a "plus(+)" mark appearing on the left side of the editor in Eclipse. If you hover your mouse over the mark, Eclipse will pop-up a frame showing those folded codes. I feel it's annoying, but ...

How to fold STL container

Hi! I need analog of Haskell's foldl function to fold any STL containers. Expected signature is like following: template Iterator, FoldingFunction, Result Result foldl( Iterator begin, Iterator end, FoldingFunction f, Result initValue); Standard STL has no such function. Does Boost have any? I know it's pretty simple to im...