Post Reply 
Uppercase vs lowercase clarification
04-30-2018, 04:44 AM
Post: #1
Uppercase vs lowercase clarification
I prefer programming in lower case, so usually can get away with programming in lowercase eg.
Code:

is_digit(c)  // is character c a digit or .
begin
  local ch := asc(c);
  ch := ch[0];  // asc returns a list so extract the val we want
  return (ch >= 48 and ch <= 57) or c = ".";
end;

str_to_int(s)  // convert into int if possible, otherwise return original
begin
  local i, result, c, is_int;
  for i from 1 to size(s) do
    if NOT is_digit(s[i, 1]) then 
      return s; end;
  end;
  return expr(s);
end;

export aslist(s)  // split a string of lines into a list
begin
  local i, line := "";
  local result := {};
  for i from 1 to size(s) do
    if s[i] = 10 then
      if size(line) > 0 then 
        line := str_to_int(line);
        result := concat(result, line); end;
      line := "";
    else
      line := line + s[i,1]
    end;
  end;
  if size(line) > 0 then 
    line := str_to_int(line);
    result := concat(result, line); end;
  return result;
end;
which comes from my recent post re RPN simulator helper utility for prime.

I did have to change the 'not' into NOT however.

Can anyone tell me what words cannot be lowercase? And what normal mode (non-cas) functions might clash with lowercase cas functions if they were expressed in lowercase?

The reason I am asking is twofold. I want to program in lowercase, for non-cas mode programs. And I want to extend the syntax highlighter for Mac Textwrangler/BBEdit correctly, see my recent post.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Uppercase vs lowercase clarification - tcab - 04-30-2018 04:44 AM



User(s) browsing this thread: 1 Guest(s)