Calendar - for "REAL" programmers: Difference between revisions
m
→{{header|Phix}}: use pygments
m (→{{header|Phix}}: use pygments) |
|||
(15 intermediate revisions by 10 users not shown) | |||
Line 1:
[[Category:Handicap]]
{{task|Date and time}}
Line 32 ⟶ 33:
'''Trivia:''' The terms uppercase and lowercase date back to the early days of the mechanical printing press. Individual metal alloy casts of each needed letter, or punctuation symbol, were meticulously added to a press block, by hand, before rolling out copies of a page. These metal casts were stored and organized in wooden cases. The more often needed ''minuscule'' letters were placed closer to hand, in the lower cases of the work bench. The less often needed, capitalized, ''majuscule'' letters, ended up in the harder to reach upper cases.
<br><br>
=={{header|360 Assembly}}==
<!-- Calendar for real programmers -->
This is for real programmers who code only in assembler :). The code could have been run in april 1964, punched on
80-column cards, read on a card reader, and printed with a 132-column line printer on fan-folded paper with perforated edges.
<
CALENDAR CSECT
USING CALENDAR,R13 BASE REGISTER
Line 217:
DA DS 12CL144
YREGS
END CALENDAR</
{{out}}
<pre> INSERT SNOOPY HERE
Line 237:
28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Ada}}==
Line 243 ⟶ 242:
Instead of doing that, the implementation below reuses the package "PRINTABLE_CALENDAR" (same as "Printable_Calendar" or "printable_calendar") from [[Calendar#Ada|the calendar task]]:
<
PROCEDURE REAL_CAL IS
Line 263 ⟶ 262:
C.NEW_LINE;
C.PRINT(1969, "NINETEEN-SIXTY-NINE");
END REAL_CAL;</
{{out}}
Line 288 ⟶ 287:
To change the output to 80-character devices, replace "INIT_132" by "INIT_80".
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|Revision 1 - no extensions to language used}}
Line 296 ⟶ 294:
Note: to run this code with [[ALGOL 68G]] you need to use the '''--quote-stropping''' option.
<
'PROC' PRINT CALENDAR = ('INT' YEAR, PAGE WIDTH)'VOID': 'BEGIN'
Line 403 ⟶ 401:
LINE PRINTER WIDTH = 132; # AS AT 1969! #
PRINT CALENDAR(MANKIND STEPPED ON THE MOON, LINE PRINTER WIDTH)
'END'</
{{out}}
<pre>
Line 426 ⟶ 424:
31 30
</pre>
=={{header|AutoHotkey}}==
<
LASTDAY := [], DAY := []
TITLES =
Line 466 ⟶ 463:
STRINGREPLACE, RES, RES,%A_SPACE%0,%A_SPACE%%A_SPACE%, ALL
RETURN RES
}</
Examples:<
GUI, FONT,S8, COURIER
GUI, ADD, EDIT, VYR W40 R1 LIMIT4 NUMBER, 1969
Line 482 ⟶ 479:
GUICLOSE:
EXITAPP
RETURN</
{{out}}
<pre> 1969
Line 522 ⟶ 519:
30
</pre>
=={{header|BASIC}}==
==={{header|BaCon}}===
Choosing 132 character output. Same as the "Calendar" from [[Calendar#BaCon|the calendar task]] but using all capitals:
<
DECLARE MON[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
Y$ = "1969"
Line 557 ⟶ 554:
PRINT D;
NEXT
NEXT</
{{out}}
Line 580 ⟶ 577:
</pre>
==={{header|BBC BASIC}}===
{{works with|BBC BASIC for Windows}}
<
YEAR = 1969
Line 625 ⟶ 622:
DEF FNDIM(M%,Y%)
CASE M% OF
WHEN 2: = 28
WHEN 4,6,9,11: = 30
OTHERWISE = 31
ENDCASE</
{{out}}
<pre>
Line 651 ⟶ 648:
27 28 29 30 31 24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
31 30</pre>
=={{header|C}}==
<b>Note:</b> Historically, some UNIX systems were connected to upper-case only terminals, and users of those systems needed to write C programs. One could configure the terminal using the "stty" command, setting the olcuc and iuclc options to translate uppercase to lowercase on input, and convert lowercase to uppercase on output (although typically the setting was applied by the "getty" program so that logging in would be possible).
Line 671 ⟶ 666:
tcc -DSTRUCT=struct -DCONST=const -DINT=int -DCHAR=char -DVOID=void -DMAIN=main -DIF=if -DELSE=else -DWHILE=while -DFOR=for -DDO=do -DBREAK=break -DRETURN=return -DPUTCHAR=putchar UCCALENDAR.c
</pre>
<
/* ERROR MESSAGES GO TO STDOUT TO SLIGHTLY SIMPLIFY THE I/O HANDLING */
/* WHEN COMPILING THIS, THE COMMAND LINE SHOULD SPECIFY -D OPTIONS FOR THE FOLLOWING WORDS: */
Line 836 ⟶ 831:
}
RETURN RESULT;
}</
=={{header|COBOL}}==
Although it seems to be missing the pinup of Snoopy, see [[Calendar#COBOL|COBOL Calendar task entry]]
where the code, and output, is already an example of a "REAL programmer" calendar; even down to the 6 character, all uppercase, program name ''CALEND''.
=={{header|Common Lisp}}==
<
(DEFPARAMETER *DAY-ROW* "SU MO TU WE TH FR SA")
Line 917 ⟶ 910:
(LAMBDA (&REST HEADS)
(FORMAT T FORMAT-STRING HEADS))
ROW))))</
{{out}}
<pre>CL-USER> (PRINT-CALENDAR 1969)
Line 956 ⟶ 949:
30
NIL</pre>
=={{header|D}}==
D keywords are lower case, so this silly solution uses the whole Calendar Task code, with small changes and all in upper case, in a text file named "CALENDAR":
Line 1,013 ⟶ 1,005:
Then in another source code file there is a little loader, that imports it and mixes-in it (for safety this program must be compiled with <code>-Jsomepath</code>):
<
{{out}}
<pre> [Snoopy Picture]
Line 1,053 ⟶ 1,045:
26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
30 </pre>
=={{header|Elena}}==
ELENA
<
import system'routines;
import system'calendar;
Line 1,062 ⟶ 1,053:
import extensions'routines;
const MonthNames = new string[]{"JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"};
const DayNames = new string[]{"MO", "TU", "WE", "TH", "FR", "SA", "SU"};
class CalendarMonthPrinter
{
{ _line.print(" ",name) }
}
get
set
}
class Calendar
{
Array.allocate(
.populate::(j =>
new CalendarMonthPrinter(
{
line.forEach::(printer)
{
}
public program()
{
}</
{{out}}
<pre>
Line 1,255 ⟶ 1,246:
27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Forth}}==
<syntaxhighlight lang="forth">
: WEEKDAY ( D M Y -- U )
OVER 3 < IF SWAP 12 + SWAP 1- THEN
DUP 4 / OVER 100 / - OVER 400 / + + SWAP 1+ 13 * 5 / + + 2 - 7 MOD ;
: MDAYS ( M Y -- MSIZE MDAY )
OVER 12 = IF 31 1 2SWAP WEEKDAY NEGATE EXIT THEN
2>R 1 2R@ WEEKDAY 1 2R> SWAP 1+ SWAP WEEKDAY OVER -
7 + 7 MOD 28 + SWAP NEGATE ;
: .WEEK ( MSIZE MDAY -- MSIZE MDAY' )
7 0 DO DUP 0< IF 1+ 3 SPACES ELSE
2DUP > IF 1+ DUP 2 .R SPACE ELSE 3 SPACES THEN THEN LOOP ;
: .3MONTHS ( Y M -- )
3 0 DO ." MO TU WE TH FR SA SU " LOOP CR
3 OVER + SWAP DO I OVER MDAYS ROT LOOP DROP
6 0 DO 2ROT .WEEK 2 SPACES 2ROT .WEEK 2 SPACES 2ROT .WEEK CR LOOP
2DROP 2DROP 2DROP ;
: CAL ( Y -- )
30 SPACES ." [SNOOPY]" CR
32 SPACES DUP . CR
." JANUARY FEBRUARY MARCH" CR
DUP 1 .3MONTHS
." APRIL MAY JUNE" CR
DUP 4 .3MONTHS
." JULY AUGUST SEPTEMBER" CR
DUP 7 .3MONTHS
." OCTOBER NOVEMBER DECEMBER" CR
10 .3MONTHS ;
1969 CAL
</syntaxhighlight>
{{out}}
<pre>
[SNOOPY]
1969
JANUARY FEBRUARY MARCH
MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU
1 2 3 4 5 1 2 1 2
6 7 8 9 10 11 12 3 4 5 6 7 8 9 3 4 5 6 7 8 9
13 14 15 16 17 18 19 10 11 12 13 14 15 16 10 11 12 13 14 15 16
20 21 22 23 24 25 26 17 18 19 20 21 22 23 17 18 19 20 21 22 23
27 28 29 30 31 24 25 26 27 28 24 25 26 27 28 29 30
31
APRIL MAY JUNE
MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU
1 2 3 4 5 6 1 2 3 4 1
7 8 9 10 11 12 13 5 6 7 8 9 10 11 2 3 4 5 6 7 8
14 15 16 17 18 19 20 12 13 14 15 16 17 18 9 10 11 12 13 14 15
21 22 23 24 25 26 27 19 20 21 22 23 24 25 16 17 18 19 20 21 22
28 29 30 26 27 28 29 30 31 23 24 25 26 27 28 29
30
JULY AUGUST SEPTEMBER
MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU
1 2 3 4 5 6 1 2 3 1 2 3 4 5 6 7
7 8 9 10 11 12 13 4 5 6 7 8 9 10 8 9 10 11 12 13 14
14 15 16 17 18 19 20 11 12 13 14 15 16 17 15 16 17 18 19 20 21
21 22 23 24 25 26 27 18 19 20 21 22 23 24 22 23 24 25 26 27 28
28 29 30 31 25 26 27 28 29 30 31 29 30
OCTOBER NOVEMBER DECEMBER
MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU
1 2 3 4 5 1 2 1 2 3 4 5 6 7
6 7 8 9 10 11 12 3 4 5 6 7 8 9 8 9 10 11 12 13 14
13 14 15 16 17 18 19 10 11 12 13 14 15 16 15 16 17 18 19 20 21
20 21 22 23 24 25 26 17 18 19 20 21 22 23 22 23 24 25 26 27 28
27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Fortran}}==
Alas, the header "FORTRAN" is not recognised - REAL programmers were absent that day? Even upon the apperance of lower case, I have preferred to use shouting for programme source, and normal upper/lower case for commentary. Aside from petty details such as 1 and l being nowhere as distinct as 1 and L, this allows the two sorts of blather to be identifiably different without ratiocination as the hours drag past. Further, the names of variables can easily be distinguished from the same word in discussion, as in ... the text in TEXT will be printed as the subtitle to the text in TITLE ... Anyway, in the spirit of old, herewith the source without tedious commentary:
<syntaxhighlight lang="fortran">
MODULE DATEGNASH
Line 1,434 ⟶ 1,495:
END DO
END
</syntaxhighlight>
And for output, the wide form:
Line 1,457 ⟶ 1,518:
</pre>
Actual lineprinters offer the opportunity of overprinting lines so double (or triple) printing of the same text gave a '''bold''' effect if with some blurring due to wobble. Further decoration was possible: via underlines (and for overlines, an underline on the previous line) the appearance can be improved. Vertical bars can also be used, and more advanced lineprinters (IBM1403 etc. using the "TN" chain) or dot-matrix printers also supplied "corner" glyphs so that boxes would not have leaks.
=={{header|FreeBASIC}}==
<
' COMPILE WITH: FBC -S CONSOLE
Line 1,555 ⟶ 1,617:
PRINT : PRINT "HIT ANY KEY TO END PROGRAM"
SLEEP
END</
{{out}}
<pre> INSERT YOUR SNOOPY PICTURE HERE
Line 1,576 ⟶ 1,638:
21 22 23 24 25 26 27 18 19 20 21 22 23 24 22 23 24 25 26 27 28 20 21 22 23 24 25 26 17 18 19 20 21 22 23 22 23 24 25 26 27 28
28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31 </pre>
=={{header|FutureBasic}}==
REAL PROGRAMMERS USE THE COMMAND LINE. (ALL UPPERCASE...UGH! =:^0 )
<syntaxhighlight lang="futurebasic">
INCLUDE "NSLOG.INCL"
LOCAL FN RUNTERMINALCOMMAND( CMD AS CFSTRINGREF ) AS CFSTRINGREF
CFSTRINGREF OUTPUTSTR = NULL
TASKREF TASK = FN TASKINIT
TASKSETEXECUTABLEURL( TASK, FN URLFILEURLWITHPATH( FN STRINGLOWERCASESTRING( @"/BIN/ZSH" ) ) )
CFSTRINGREF CMDSTR = FN STRINGWITHFORMAT( @"%@", FN STRINGLOWERCASESTRING( CMD ) )
CFARRAYREF ARGS = FN ARRAYWITHOBJECTS( FN STRINGLOWERCASESTRING( @"-C" ), CMDSTR, NULL )
TASKSETARGUMENTS( TASK, ARGS )
PIPEREF P = FN PIPEINIT
TASKSETSTANDARDOUTPUT( TASK, P )
TASKSETSTANDARDERROR( TASK, P )
FILEHANDLEREF FH = FN PIPEFILEHANDLEFORREADING( P )
FN TASKLAUNCH( TASK, NULL )
TASKWAITUNTILEXIT( TASK )
ERRORREF ERR
CFDATAREF DTA = FN FILEHANDLEREADDATATOENDOFFILE( FH, @ERR )
IF ERR THEN NSLOG( @"%@", FN ERRORLOCALIZEDDESCRIPTION( ERR ) ) : EXIT FN
OUTPUTSTR = FN STRINGWITHDATA( DTA, NSUTF8STRINGENCODING )
OUTPUTSTR = FN STRINGUPPERCASESTRING( OUTPUTSTR )
END FN = OUTPUTSTR
VOID LOCAL FN BUILDSNOOPYCALENDAR
CFSTRINGREF CALSTR = FN STRINGWITHFORMAT( FN STRINGLOWERCASESTRING( @"\n%37S\n\n%@" ), FN STRINGUTF8STRING( @"[SNOOPY HERE]" ), FN RUNTERMINALCOMMAND( FN STRINGLOWERCASESTRING( @"CAL 1969" ) ) )
NSLOG( @"%@", CALSTR )
END FN
FN BUILDSNOOPYCALENDAR
HANDLEEVENTS
</syntaxhighlight>
{{output}}
<pre style="font-size: 12px">
[SNOOPY HERE]
1969
JANUARY FEBRUARY MARCH
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 1 1
5 6 7 8 9 10 11 2 3 4 5 6 7 8 2 3 4 5 6 7 8
12 13 14 15 16 17 18 9 10 11 12 13 14 15 9 10 11 12 13 14 15
19 20 21 22 23 24 25 16 17 18 19 20 21 22 16 17 18 19 20 21 22
26 27 28 29 30 31 23 24 25 26 27 28 23 24 25 26 27 28 29
30 31
APRIL MAY JUNE
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 3 1 2 3 4 5 6 7
6 7 8 9 10 11 12 4 5 6 7 8 9 10 8 9 10 11 12 13 14
13 14 15 16 17 18 19 11 12 13 14 15 16 17 15 16 17 18 19 20 21
20 21 22 23 24 25 26 18 19 20 21 22 23 24 22 23 24 25 26 27 28
27 28 29 30 25 26 27 28 29 30 31 29 30
JULY AUGUST SEPTEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 1 2 3 4 5 6
6 7 8 9 10 11 12 3 4 5 6 7 8 9 7 8 9 10 11 12 13
13 14 15 16 17 18 19 10 11 12 13 14 15 16 14 15 16 17 18 19 20
20 21 22 23 24 25 26 17 18 19 20 21 22 23 21 22 23 24 25 26 27
27 28 29 30 31 24 25 26 27 28 29 30 28 29 30
31
OCTOBER NOVEMBER DECEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 1 1 2 3 4 5 6
5 6 7 8 9 10 11 2 3 4 5 6 7 8 7 8 9 10 11 12 13
12 13 14 15 16 17 18 9 10 11 12 13 14 15 14 15 16 17 18 19 20
19 20 21 22 23 24 25 16 17 18 19 20 21 22 21 22 23 24 25 26 27
26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
30
</pre>
=={{header|Go}}==
Line 1,585 ⟶ 1,729:
This is realcal_UC.txt:
<
IMPORT (
Line 1,655 ⟶ 1,799:
FMT.PRINTLN()
}
}</
and this is realcal.go:
<
import (
Line 1,697 ⟶ 1,841:
cmd.Stderr = os.Stderr
check(cmd.Run())
}</
which produces (as expected) this output:
Line 1,741 ⟶ 1,885:
30
</pre>
=={{header|GUISS}}==
In Graphical User Interface Support Script, we utilize applications that are already written. So for this task, we shall just display the calendar that sets the system clock.
<
=={{header|Icon}} and {{header|Unicon}}==
Icon and Unicon don't lend themselves to ''REAL'' programming in the sense of this task easily. And initially this task was marked ''omit'' because the primary declarations, reserved words, and the name of the ''main'' procedure are all in lowercase. However, getting in the spirit of the task real programmers do not give up and a number of solutions are possible:
Line 1,769 ⟶ 1,911:
Also it makes me go all nostalgic for my old [[WATFIVE]] compiler. And an IBM 129 keypunch. And 5 hole paper tape.
<
LINK DATETIME
Line 1,817 ⟶ 1,959:
IF M = 2 & ISLEAPYEAR(YEAR) THEN SUSPEND (DAY +:= 1, 29)
EVERY DAY TO (6*7) DO SUSPEND ""
END</
Where REALIZE.ICN would be something like this (this example is incomplete but sufficient for this program):
<
$define END end
$define WRITE write
Line 1,847 ⟶ 1,989:
$define BY by
$define DATETIME datetime
$define RETURN return</
{{libheader|Icon Programming Library}}
[http://www.cs.arizona.edu/icon/library/src/procs/DATETIME.ICN DATETIME.ICN provides IsLeapYear and julian]
=={{header|J}}==
For added "real"ness, we also only use 1 character names:
<
M=: 28+ 3, (10$5$3 2),~ 0 ~:/@:= 4 100 400 | ]
R=: (7 -@| B+ 0, +/\@}:@M) |."0 1 (0,#\#~41) (]&:>: *"1 >/)~ M
Line 1,864 ⟶ 2,005:
L=: |."0 1~ +/ .(*./\@:=)"1&' '
E=: (|."0 1~ _2 <.@%~ +/ .(*./\.@:=)"1&' ')@:({."1) L
F=: 0 _1 }. 0 1 }. (2+[) E '[INSERT SNOOPY HERE]', ":@], D</
B: given a year returns a number which when added to numeric values indexing days that year, mod 7, index the proper day names within a week. (In other words 7 | 0 + B 1969 gives the day of week index for the first day of 1969.)
Line 1,886 ⟶ 2,027:
Here's an example calendar (the first line <code>132 F 1969</code> being the command that build this calendar):
<syntaxhighlight lang="text"> 132 F 1969
[INSERT SNOOPY HERE]
1969
Line 1,908 ⟶ 2,049:
│ │31 │ │ │30 │ │
└────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┘
</syntaxhighlight>
Note that this version of F will work fine with a left argument of 20 (why anyone felt that this was important to mention is perhaps best thought of as an issue lost in history).
=={{header|Julia}}==
Julia code is a valid data type in Julia. Executable code can be created from a String with Meta.parse() and run with eval.
This example does require a small function with Julia's lowercase keywords, perhaps loaded on startup from a separate file.
<
# IF THIS SMALL FUNCTION IS PLACED IN THE STARTUP.JL
# FILE, IT WILL BE LOADED ON STARTUP. THE REST OF
Line 1,973 ⟶ 2,113:
RUNUPPERCASECODE(CODE)
</
1969
JANUARY FEBRUARY MARCH APRIL MAY JUNE
Line 1,995 ⟶ 2,135:
</pre>
=={{header|Kotlin}}==
Kotlin is case-sensitive: all its keywords and packages are lower case, all its library classes are mixed case and its library functions are either lower case or mixed case. Consequently, it is impossible to run an upper case version of the Calendar task program as it stands. So what I've done instead (and similar to what several other languages in the same boat have done) is:
Line 2,005 ⟶ 2,144:
This is calendar_UC.txt:
<
IMPORT JAVA.UTIL.*
IMPORT JAVA.IO.PRINTSTREAM
Line 2,056 ⟶ 2,195:
FUN MAIN(ARGS: ARRAY<STRING>) {
SYSTEM.OUT.PRINTCALENDAR(1969, 3, LOCALE.US)
}</
and this is real_calendar.kt:
<
import java.io.File
Line 2,143 ⟶ 2,282:
br.close()
println(out.toString())
}</
which generates (on disk) calendar_NC.kt:
<
import java.util.*
import java.io.PrintStream
Line 2,198 ⟶ 2,337:
fun main(args: Array<String>) {
System.out.PRINTCALENDAR(1969, 3, Locale.US)
}</
which when compiled and run produces output of:
Line 2,242 ⟶ 2,381:
30
</pre>
=={{header|Lua}}==
Tested with Lua 5.3.2
Line 2,250 ⟶ 2,388:
The upper case Lua source - stored in a file called UCCALENDAR.LUU:
<br>
<
LOCAL MONTHS={"JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE",
"JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"}
Line 2,313 ⟶ 2,451:
PRINT_CAL(1969)
</syntaxhighlight>
The following "one-liner" standard Lua source will down-case and run the program in the source file specified as it's parameter (file luu.lua):
<
</syntaxhighlight>
The following command will execute the UCCALENDAR.LUU source (replace lua532 with the appropriate command for your system):
<br>
Line 2,365 ⟶ 2,503:
</pre>
=={{header|M2000 Interpreter}}==
Console 132 characters by 43 lines. Six columns for months.
<syntaxhighlight lang="m2000 interpreter">
\\ Calendar - for "REAL" programmers
\\ All statements in UPPERCASE
Line 2,517 ⟶ 2,654:
END WHILE
RETURN
</syntaxhighlight>
=={{header|Nim}}==
Nim is a peculiar language regarding case sensitivity. First, keywords are all in lowercase. Second, Nim is case sensitive regarding the first character only. That means that ''Thing'' is different of ''thing'' but identical to ''THING''. There are several conventions regarding the style. For instance, the first character of a type should be in uppercase while the first character of a procedure or a variable should be in lowercase. Nim is also style-insensitive which means that "myvar", "myVar" and "my_var" are equivalent identifiers.
Line 2,528 ⟶ 2,664:
Here is the helper program:
<syntaxhighlight lang="text">import strutils
const progUpper = staticRead("calendar_upper.txt")
Line 2,558 ⟶ 2,694:
static: writeFile("calendar_transformed.nim", prog)
include "calendar_transformed.nim"</
Here is the actual program in uppercase.
<syntaxhighlight lang="text">IMPORT TIMES
IMPORT STRFORMAT
Line 2,599 ⟶ 2,735:
ECHO ""
PRINTCALENDAR(1969, 5)</
{{out}}
Line 2,633 ⟶ 2,769:
24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Perl}}==
Since we can't use <code>eval</code> or <code>print</code> (or any other keywords)
at the top level, we need to abuse backticks in order to print anything, as in [http://www.perlmonks.org/?node_id=43797 the infamous JAPH with no letters or numbers]. Consequently, the calendar is printed to standard error instead of standard output.
<
MY @START_DOW = (3, 6, 6, 2, 4, 0,
Line 2,681 ⟶ 2,816:
$L = ',' | '@';
`${E}${C}${H}${O} $PROGRAM | ${T}${R} A-Z ${A}-${Z} | ${P}${E}${R}${L}`;</
Although, if we are abusing the backticks and other innocent programs, why not just: <
=={{header|Phix}}==
<syntaxhighlight lang="phix">
--return repeat(' ',left)&s&repeat(' ',right)
</syntaxhighlight>
(That's that done.) Now, Phix is case-sensitive, and many of the keywords and builtins are in lower case, which presents a bit of a challenge - but we can cope. It is too tedious and not particularly helpful to present a completed solution, instead I shall outline the (relatively simple) steps this would require. I have limited my tests to INCLUDE and INTEGER. In psym.e you can find the line
<syntaxhighlight lang="phix">
initialSymEntry("integer", S_Type,"TI",opInt, E_none) -- #01 / 0b0001 integer
</syntaxhighlight>
Immediately after that (it should now be there commented out) add:
<syntaxhighlight lang="phix">
Alias("INTEGER",symlimit)
</syntaxhighlight>
Add similar lines for length, floor, repeat, upper, day_of_week, sequence, string, sprintf, append, printf, join, at the appropriate places. Keywords are handled slightly differently: In pttree.e we need a new alias routine (you should find this one commented out, from when I was testing all this):
<syntaxhighlight lang="phix">
tt_string(text,-2)
tt[pcurr] = alias
end procedure
</syntaxhighlight>
and you can find the line
<syntaxhighlight lang="phix">
global constant T_include = 596 tt_stringF("include",T_include)
</syntaxhighlight>
Sometime after that, in fact after the very last use of tt_stringF, add (likewise you should find this one commented out):
<syntaxhighlight lang="phix">
tt_stringA("INCLUDE",T_include)
</syntaxhighlight>
Add similar lines for function, end, iff, for, to, do, if, or, then, else, return, procedure, but this time all some ways away from the originals. Quickly run "p p" and make sure you get a normal prompt, without any "T_include should be 624(not 596)" or suchlike (which would happen <i>alot</i> if you put the aliases anywhere other than last).
Currently ptok.e recognises <code>\n</code> but not <code>\N</code>. Search for all references to <code>escchar</code> (there should be one definition and two references) and make sure the character being
checked is mapped to lower case, ie change (twice)
<syntaxhighlight lang="phix">
--Ch = find(Ch,escchar)
</syntaxhighlight>
Lastly, the calendar example includes builtins\timedate.e, which contains some lower-case definitions. So copy it to (say) TIMEDATEUPPER.E and change adjust_timedate, timedelta, days (the 2nd param to timedelta), and format_timedate to their uppercase equivalents, and of course change that include to <code>INCLUDE BUILTINS\TIMEDATEUPPER.E</code>.
There
You don't actually have to repackage (p -c p) to test this, just run p p test.exw -
Finally, you can take that copy of [[Calendar#Phix|Calendar]] and make it all uppercase. In Edita (shipped with Phix) that is just <Ctrl A><Alt U>.
Line 2,730 ⟶ 2,868:
While PHP functions are case-sensitive (aside of <code>_()</code>), this isn't the case for language constructs.
<
ECHO <<<REALPROGRAMMERSTHINKINUPPERCASEANDCHEATBYUSINGPRINT
JANUARY FEBRUARY MARCH APRIL MAY JUNE
Line 2,749 ⟶ 2,887:
28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
REALPROGRAMMERSTHINKINUPPERCASEANDCHEATBYUSINGPRINT
; // MAGICAL SEMICOLON</
=={{header|PicoLisp}}==
The "CALENDAR.L" source file:
<
(PRINL "====== " YEAR " ======")
(FOR DAT (RANGE (DATE YEAR 1 1) (DATE YEAR 12 31))
Line 2,766 ⟶ 2,903:
(CAL 1969)
(BYE)</
Then it can be executed with this command line:
<pre>$ pil -'load (list "awk" "{print tolower($0)}" "CALENDAR.L")'</pre>
Line 2,794 ⟶ 2,931:
30 Tue
31 Wed</pre>
=={{header|PL/I}}==
<
CALENDAR: PROCEDURE (YEAR) OPTIONS (MAIN);
DECLARE YEAR CHARACTER (4) VARYING;
Line 2,847 ⟶ 2,983:
END PREPARE_MONTH;
END CALENDAR;</
See CALENDAR for result.
=={{header|Racket}}==
<
#CI(MODULE NAME-OF-THIS-FILE RACKET
(REQUIRE RACKET/DATE)
Line 2,887 ⟶ 3,022:
(CALENDAR 1969))
</syntaxhighlight>
=={{header|Raku}}==
(formerly Perl 6)
Uppercase is no challenge, who needs letters at all?
[Requires the year to be supplied as a command-line argument, and Unixish <i>cal</i> command.]
<syntaxhighlight lang="raku"
115 97 121 32 34 91 73 78 83 69 82 84 32 83 78 79 79 80 89 32 72 69 82 69 93 34
59 114 117 110 32 60 99 97 108 62 44 64 42 65 82 71 83 91 48 93 47 47 49 57 54 57
>."$_[99]$_[104]$_[114]$_[115]"()."$_[69]$_[86]$_[65]$_[76]"()</
=={{header|REXX}}==
This is essentially the same REXX program as for the CALENDAR task, but written entirely in uppercase. Indeed,
Line 2,919 ⟶ 3,052:
(but the second REXX version sure as heck looks
<br>like it was beat with a big ole ugly stick ─── and pardon the strong language).
<
@ABC=
PARSE VALUE SCRSIZE() WITH SD SW .
Line 3,091 ⟶ 3,224:
PUT:_=ARG(1);_=TRANSLATE(_,,'_'CHK);IF \GRID THEN _=UNGRID(_);IF LOWERCASE THEN _=LOWER(_);IF UPPERCASE THEN UPPER _;IF SHORTEST&_=' ' THEN RETURN;CALL TELL _;RETURN
TELL:SAY ARG(1);RETURN
UNGRID:RETURN TRANSLATE(ARG(1),,"│║─═┤┐└┴┬├┼┘┌╔╗╚╝╟╢╞╡╫╪╤╧╥╨╠╣")</
Programming note: This REXX program makes use of '''SCRSIZE''' REXX program (or
BIF) which is used to determine the screen
Line 3,198 ⟶ 3,331:
└────┴────┴────┴────┴────┴────┴────┘
</pre>
=={{header|Ring}}==
<
# PROJECT : CALENDAR - FOR "REAL" PROGRAMMERS
# DATE : 2018/06/28
Line 3,359 ⟶ 3,491:
NEXT
NEXT
</syntaxhighlight>
Output:
[https://www.dropbox.com/s/lb7rnqdb30a72kc/CalmoSoftRealCalendar.jpg?dl=0 CALENDAR - FOR "REAL" PROGRAMMERS]
=={{header|Ruby}}==
UPPERCASE RUBY is normally impossible, because Ruby is sensitive to case, and most methods and keywords have lowercase letters. To solve this task, we wrote a new program loader for UPPERCASE RUBY programs.
Line 3,370 ⟶ 3,501:
* <code>loadup.rb</code> is the program loader.
<
class Object
Line 3,395 ⟶ 3,526:
_PROGRAM = ARGV.SHIFT
_PROGRAM || ABORT("USAGE: #{$0} PROGRAM.RB ARGS...")
LOAD($0 = _PROGRAM)</
* <code>CAL.RB</code> is an UPPERCASE RUBY translation of [[Calendar#Ruby]].
{{works with|Ruby|1.8.7}}
<
REQUIRE 'DATE'.DOWNCASE
Line 3,482 ⟶ 3,613:
PROC {80}) }) })
PUTS CAL(ARGV[0].TO_I, _COLUMNS)</
* A local variable must start with a lowercase letter or an underscore, so we have many leading underscores (_YEAR, _COLUMN, _DATE and so on).
Line 3,509 ⟶ 3,640:
27 28 29 30 31 24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
31 30 </pre>
=={{header|Seed7}}==
Seed7 keywords are lower case, so this silly solution uses the whole Calendar Task code, with small changes and all in upper case, in a text file named "CALENDAR.TXT":
Line 3,567 ⟶ 3,697:
Then in another program the file CALENDAR.TXT is [http://seed7.sourceforge.net/libraries/getf.htm#getf%28in_string%29 read], converted, [http://seed7.sourceforge.net/libraries/progs.htm#parseStri%28in_string,in_parseOptions,in_array_string,in_string%29 parsed] and [http://seed7.sourceforge.net/libraries/progs.htm#execute%28in_program,in_array_string,in_parseOptions,in_string%29 executed]:
<
include "getf.s7i";
include "progs.s7i";
Line 3,579 ⟶ 3,709:
source := replace(source, "daysinmonth", "daysInMonth");
execute(parseStri(source));
end func;</
{{out}}
Line 3,620 ⟶ 3,750:
27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Sidef}}==
<
-> MONTHS_PER_COL { 6 }
Line 3,680 ⟶ 3,809:
}
FMT_YEAR(ARGV ? ARGV[0].("\LTO_I") : 1969).("\LPRINT")</
{{out}}
<pre>
Line 3,700 ⟶ 3,829:
28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Tcl}}==
The program starts implementing aliases for all built-in commands. This is done without using any letters at all ;).
CALENDER takes arguments of year and optional terminal width to use.
<
\146\157\162\145\141\143\150 42 [\151\156\146\157 \143\157\155\155\141\156\144\163] {
\145\166\141\154 "
Line 3,753 ⟶ 3,881:
CALENDAR
</syntaxhighlight>
{{out}}
<pre>
Line 3,792 ⟶ 3,920:
27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|UNIX Shell}}==
===Using Bash Case-Converting Parameter Expansion===
<syntaxhighlight lang="shell">CAL=CAL
TR=TR
A=A
Z=Z
LANG=C ${CAL,,} 1969 | ${TR,,} ${A,}-${Z,} A-Z</
{{out}}
<pre>
Line 3,835 ⟶ 3,964:
27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
===HISTORICALLY REAL WAY: INFORM UNIX YOUR TTY ONLY SUPPORTS CAPS===
<pre>sun-go:~$ stty olcuc
SUN-GO:~$ PS AUX | GREP PS
KERNOOPS 1159 0.0 0.0 10240 64 ? SS JUL04 3:59 /USR/SBIN/KERNELOOPS --TEST
KERNOOPS 1161 0.0 0.0 10240 64 ? SS JUL04 3:59 /USR/SBIN/KERNELOOPS
KAZ 2279 0.0 0.2 111724 5340 TTY2 SNL+ JUL04 0:00 /USR/LIB/TRACKER/TRACKER-MINER-APPS
ROOT 9404 0.0 0.3 19092 7600 ? SS 00:09 0:00 /USR/SBIN/CUPSD -L
ROOT 9406 0.0 0.4 44248 9772 ? SSL 00:09 0:00 /USR/SBIN/CUPS-BROWSED
KAZ 30121 4.0 0.1 8760 3072 PTS/3 R+ 09:38 0:00 PS AUX
KAZ 30122 0.0 0.0 6520 788 PTS/3 S+ 09:38 0:00 GREP PS
SUN-GO:~$ GREP ROOT /ETC/PASSWD
ROOT:X:0:0:ROOT:/ROOT:/BIN/BASH
SUN-GO:~$ CAL 1969
1969
JANUARY FEBRUARY MARCH
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 1 1
5 6 7 8 9 10 11 2 3 4 5 6 7 8 2 3 4 5 6 7 8
12 13 14 15 16 17 18 9 10 11 12 13 14 15 9 10 11 12 13 14 15
19 20 21 22 23 24 25 16 17 18 19 20 21 22 16 17 18 19 20 21 22
26 27 28 29 30 31 23 24 25 26 27 28 23 24 25 26 27 28 29
30 31
APRIL MAY JUNE
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 3 1 2 3 4 5 6 7
6 7 8 9 10 11 12 4 5 6 7 8 9 10 8 9 10 11 12 13 14
13 14 15 16 17 18 19 11 12 13 14 15 16 17 15 16 17 18 19 20 21
20 21 22 23 24 25 26 18 19 20 21 22 23 24 22 23 24 25 26 27 28
27 28 29 30 25 26 27 28 29 30 31 29 30
JULY AUGUST SEPTEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 1 2 3 4 5 6
6 7 8 9 10 11 12 3 4 5 6 7 8 9 7 8 9 10 11 12 13
13 14 15 16 17 18 19 10 11 12 13 14 15 16 14 15 16 17 18 19 20
20 21 22 23 24 25 26 17 18 19 20 21 22 23 21 22 23 24 25 26 27
27 28 29 30 31 24 25 26 27 28 29 30 28 29 30
31
OCTOBER NOVEMBER DECEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 1 1 2 3 4 5 6
5 6 7 8 9 10 11 2 3 4 5 6 7 8 7 8 9 10 11 12 13
12 13 14 15 16 17 18 9 10 11 12 13 14 15 14 15 16 17 18 19 20
19 20 21 22 23 24 25 16 17 18 19 20 21 22 21 22 23 24 25 26 27
26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
30
SUN-GO:~$ STTY SANE
sun-go:~$</pre>
=={{header|Vedit macro language}}==
Line 3,843 ⟶ 4,025:
Vedit macro language is case insensitive, but it is normal practice to write short commands in upper case.
<
CFT(22)
#3 = 6 // NUMBER OF MONTHS PER LINE
Line 3,907 ⟶ 4,089:
REG_EMPTY(#20)
NUM_POP(4,20)
RETURN </
<pre>
Line 3,933 ⟶ 4,115:
28 29 30 31 25 26 27 28 29 30 31 29 30 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
</pre>
=={{header|Visual Basic .NET}}==
'''Compiler:''' Roslyn Visual Basic (language version >= 15.8)
Line 3,940 ⟶ 4,121:
Copied from [[Calendar#Visual_Basic_.NET]] and converted to uppercase. See entry there for description.
<
OPTION EXPLICIT ON
OPTION INFER ON
Line 4,270 ⟶ 4,451:
RETURN S.PADLEFT(((TOTALWIDTH - S.LENGTH) \ 2) + S.LENGTH, PADDINGCHAR).PADRIGHT(TOTALWIDTH, PADDINGCHAR)
END FUNCTION
END MODULE</
{{out|input=COLS:132 ROWS:25 MS/ROW:6 HSTRETCH:FALSE VSTRETCH:FALSE}}
Line 4,296 ⟶ 4,477:
</pre>
=={{header|Wren}}==
Strictly speaking, ''real'' programming is impossible in Wren which is case sensitive and keywords, library classes, methods etc. never use all upper case letters.
We therefore do what other languages in a similar predicament have done and begin by creating an all upper case version of the calendar program called ''calendar_real_uc.txt'':
{{libheader|Wren-date}}
{{libheader|Wren-fmt}}
{{libheader|Wren-seq}}
<syntaxhighlight lang="text">IMPORT "./DATE" FOR DATE
IMPORT "./FMT" FOR FMT
IMPORT "./SEQ" FOR LST
VAR CALENDAR = FN.NEW { |YEAR|
VAR SNOOPY = "🐶"
VAR DAYS = "SU MO TU WE TH FR SA"
VAR MONTHS = [
"JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE",
"JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"
]
FMT.PRINT("$70M", SNOOPY)
VAR YEARSTR = "--- %(YEAR) ---"
FMT.PRINT("$70M\N", YEARSTR)
VAR FIRST = LIST.FILLED(3, 0)
VAR MLEN = LIST.FILLED(3, 0)
VAR C = 0
FOR (CHUNK IN LST.CHUNKS(MONTHS, 3)) {
FOR (I IN 0..2) FMT.WRITE("$20M ", CHUNK[I])
SYSTEM.PRINT()
FOR (I IN 0..2) SYSTEM.WRITE("%(DAYS) ")
SYSTEM.PRINT()
FIRST[0] = DATE.NEW(YEAR, C*3 + 1, 1).DAYOFWEEK % 7
FIRST[1] = DATE.NEW(YEAR, C*3 + 2, 1).DAYOFWEEK % 7
FIRST[2] = DATE.NEW(YEAR, C*3 + 3, 1).DAYOFWEEK % 7
MLEN[0] = DATE.MONTHLENGTH(YEAR, C*3 + 1)
MLEN[1] = DATE.MONTHLENGTH(YEAR, C*3 + 2)
MLEN[2] = DATE.MONTHLENGTH(YEAR, C*3 + 3)
FOR (I IN 0..5) {
FOR (J IN 0..2) {
VAR START = 1 + 7 * I - FIRST[J]
FOR (K IN START..START+6) {
IF (K >= 1 && K <= MLEN[J]) {
FMT.WRITE("$2D ", K)
} ELSE {
SYSTEM.WRITE(" ")
}
}
SYSTEM.WRITE(" ")
}
SYSTEM.PRINT()
}
SYSTEM.PRINT()
C = C + 1
}
}
CALENDAR.CALL(1969)</syntaxhighlight>
We then create a script called ''calendar_real.wren'' which takes the above text file as input, changes those items which cannot be upper case into their normal casing and compiles and runs the result:
{{libheader|Wren-str}}
<syntaxhighlight lang="wren">import "io" for File
import "./str" for Str
import "meta" for Meta
var keywords = ["import", "for", "var", "in", "if", "else"]
var modules = ["/date", "/fmt", "/seq"]
var classes = ["Date", "Fmt", "Lst", "Fn", "List", "System"]
var methods = ["print", "filled", "chunks", "write", "new", "dayOfWeek", "monthLength", "call"]
var formats = ["$70m", "\\n", "$20m", "$2d"]
var text = File.read("calendar_real_uc.txt")
for (keyword in keywords) text = text.replace(Str.upper(keyword) + " ", keyword + " ")
for (module in modules) text = text.replace(Str.upper(module), module)
for (clazz in classes) text = text.replace(Str.upper(clazz), clazz)
for (method in methods) text = text.replace("." + Str.upper(method), "." + method)
for (format in formats) text = text.replace(Str.upper(format), format)
Meta.compile(text).call()</syntaxhighlight>
{{out}}
<pre>
🐶
--- 1969 ---
JANUARY FEBRUARY MARCH
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 1 1
5 6 7 8 9 10 11 2 3 4 5 6 7 8 2 3 4 5 6 7 8
12 13 14 15 16 17 18 9 10 11 12 13 14 15 9 10 11 12 13 14 15
19 20 21 22 23 24 25 16 17 18 19 20 21 22 16 17 18 19 20 21 22
26 27 28 29 30 31 23 24 25 26 27 28 23 24 25 26 27 28 29
30 31
APRIL MAY JUNE
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 3 1 2 3 4 5 6 7
6 7 8 9 10 11 12 4 5 6 7 8 9 10 8 9 10 11 12 13 14
13 14 15 16 17 18 19 11 12 13 14 15 16 17 15 16 17 18 19 20 21
20 21 22 23 24 25 26 18 19 20 21 22 23 24 22 23 24 25 26 27 28
27 28 29 30 25 26 27 28 29 30 31 29 30
JULY AUGUST SEPTEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 5 1 2 1 2 3 4 5 6
6 7 8 9 10 11 12 3 4 5 6 7 8 9 7 8 9 10 11 12 13
13 14 15 16 17 18 19 10 11 12 13 14 15 16 14 15 16 17 18 19 20
20 21 22 23 24 25 26 17 18 19 20 21 22 23 21 22 23 24 25 26 27
27 28 29 30 31 24 25 26 27 28 29 30 28 29 30
31
OCTOBER NOVEMBER DECEMBER
SU MO TU WE TH FR SA SU MO TU WE TH FR SA SU MO TU WE TH FR SA
1 2 3 4 1 1 2 3 4 5 6
5 6 7 8 9 10 11 2 3 4 5 6 7 8 7 8 9 10 11 12 13
12 13 14 15 16 17 18 9 10 11 12 13 14 15 14 15 16 17 18 19 20
19 20 21 22 23 24 25 16 17 18 19 20 21 22 21 22 23 24 25 26 27
26 27 28 29 30 31 23 24 25 26 27 28 29 28 29 30 31
30
</pre>
Line 4,301 ⟶ 4,602:
ASSEMBLE WITH: TASM CALENDAR; TLINK /t CALENDAR
<
.CODE
.486
Line 4,487 ⟶ 4,788:
DAYS DB 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
DAY DB ?, ?, ?, ?, ?, ?
END START</
{{Out}}
Line 4,512 ⟶ 4,813:
31 30
</pre>
=={{header|XLISP}}==
XLISP isn't case-sensitive, so in principle it would be possible just to reproduce the solution given in the "ordinary" Calendar task. But that program makes use of recursion, "fancy" data structures, long variable names, pretty-printy indentation, and a whole host of other features that I don't think REAL programmers like any better than they like lower case: so, instead, here is a version using only global variables and "<tt>DO</tt> loops like God meant them to be".
<
(SETQ M #("JANUARY" "FEBRUARY" "MARCH" "APRIL" "MAY" "JUNE" "JULY" "AUGUST" "SEPTEMBER" "OCTOBER" "NOVEMBER" "DECEMBER"))
(SETQ ML #(31 28 31 30 31 30 31 31 30 31 30 31))
Line 4,550 ⟶ 4,850:
(SETQ D (+ D 1))
(IF (> D 6) (TERPRI))
(IF (> D 6) (SETQ D 0))))</
{{out}}
<pre> SNOOPY CALENDAR 1969
Line 4,642 ⟶ 4,942:
21 22 23 24 25 26 27
28 29 30 31</pre>
=={{header|zkl}}==
{{trans|D}}
Line 4,648 ⟶ 4,947:
The calendar code, file UPCAL.zkl (upper cased version of [[Calendar#zkl]]):
<
FCN CENTER(TEXT,M) { STRING(" "*((M-TEXT.LEN())/2),TEXT) }
Line 4,659 ⟶ 4,958:
.PUMP(LIST,T(VOID.READ,DAYS.LEN()/3,FALSE),STRING.CREATE));
}
...</
And the pre-processor, hand rolled for the above code (file bbb.zkl):
<
code=Data(Void,code.text.toLower());
mixed:=T("string","String", "list","List", " t("," T(",",t(",",T(",
Line 4,671 ⟶ 4,970:
);
mixed.pump(Void,Void.Read,'wrap(up,down){ code.replace(up,down) });
Compiler.Compiler.compileText(code)();</
{{out}}
<pre>
Line 4,684 ⟶ 4,983:
...
</pre>
{{omit from|C sharp|keywords are lower case}}
{{omit from|C++}}
{{omit from|Clojure|Clojure's keywords are lower case}}
{{omit from|D|D's keywords are lower case}}
Line 4,691 ⟶ 4,990:
{{omit from|Haskell|Haskell reserves words starting with uppercase letters for datatypes.}}
{{omit from|Java|Java's keywords are lower case}}
{{omit from|Mathematica}}
{{omit from|Processing|Processing's keywords are lower case}}
{{omit from|Python}}
{{omit from|Stata|keywords are lower case}}
{{omit from|zkl|boogers to upper case}}
|