Post any comments, suggestions, annoyances or ideas for future releases here. Please do not post bug reports or questions here.
Post Reply
Posts: 9
Joined: Mon Feb 06, 2012 7:50 am


Post by Endymion »

I saw the best decision in the jEdit editor. Any line, matching to own regular expression, automatically receives indentation. Unfortunately, even coders of this fine editor didn't finish thinking about this clever thought up to the end. It would be logical to add expression for a ledge also. Here is how it could look.



Result is formatting on-the-fly:

Code: Select all

export function permute3(sequence x)
  sequence AllPermutations = {}
  integer Quantity = length(x)
  sequence CurrentPermutation
  for i = 1 to Quantity do
    for j = 1 to Quantity do
      if i != j then
        for k = 1 to Quantity do
          if k != i and k != j then
            CurrentPermutation = x[i] & x[j] & x[k]
            AllPermutations = append(AllPermutations, CurrentPermutation)
          end if
        end for
      end if
    end for
  end for
  return AllPermutations
end function
Post Reply