Hi Waldek,

in the BOOT code below, there is "=> return nil".
Obviously, I shouldn't interpret the code as if it where SPAD code,
because then either

  a) the while loop ends with lines=nil and the following "null lines"
     would let the function return with result nil, or
  b) substring?(header,line,k) is true and checkExtract returns nil.

Seems that "return" inside a while loop after "=>" is a no-op.

Ralf

checkExtract(header,lines) ==
  while lines repeat
    line := first lines
    k := firstNonBlankPosition line           --k gives margin of
Description:
    substring?(header,line,k) => return nil
    lines := rest lines
  null lines => nil
  u := first lines
  j := charPosition(char '_:,u,k)
  margin := k
  firstLines :=
    (k := firstNonBlankPosition(u,j + 1)) ~= -1 =>
      [SUBSTRING(u,j + 1,nil),:rest lines]
    rest lines
  --now look for another header; if found skip all rest of these lines
  acc := nil
  for line in firstLines repeat
    do
      m := #line
      (k := firstNonBlankPosition line) = -1     => 'skip  --include if
blank
      k > margin                                 => 'skip  --include if
idented
      not UPPER_-CASE_-P line.k                  => 'skip  --also if not
upcased
      (j := charPosition(char '_:,line,k)) = m   => 'skip  --or if not
colon, or
      (i := charPosition(char '_ ,line,k+1)) < j => 'skip  --blank
before colon
      return nil
    acc := [line,:acc]
  NREVERSE acc

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to