.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Lingua::Romana::Perligata 3pm" .TH Lingua::Romana::Perligata 3pm "2022-12-02" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NOMEN" .IX Header "NOMEN" Lingua::Romana::Perligata \*(-- Perl in Latin .SH "EDITIO" .IX Header "EDITIO" This document describes version 0.55 of Lingua::Romana::Perligata, released February 20, 2003. .SH "SUMMARIUM" .IX Header "SUMMARIUM" .Vb 1 \& #! /usr/local/bin/perl \-w \& \& use Lingua::Romana::Perligata; \& \& adnota Illud Cribrum Eratothenis \& \& maximum tum val inquementum tum biguttam tum stadium egresso scribe. \& vestibulo perlegementum da meo maximo . \& maximum tum novumversum egresso scribe. \& da II tum maximum conscribementa meis listis. \& dum damentum nexto listis decapitamentum fac sic \& lista sic hoc tum nextum recidementum cis vannementa da listis. \& next tum biguttam tum stadium tum nextum tum novumversum \& scribe egresso. \& cis .Ve .SH "DESCRIPTIO" .IX Header "DESCRIPTIO" The Lingua::Romana::Perligata makes it makes it possible to write Perl programs in Latin. (If you have to ask \*(L"Why?\*(R", then the answer probably won't make any sense to you either.) .PP The linguistic principles behind Perligata are described in: .PP .Vb 1 \& http://www.csse.monash.edu.au/~damian/papers/HTML/Perligata.html .Ve .PP The module is \f(CW\*(C`use\*(C'\fRd at the start of the program, and installs a filter which allows the rest of the program to be written in (modified) Latin, as described in the following sections. .SH "GRAMMATICA PERLIGATA" .IX Header "GRAMMATICA PERLIGATA" .SS "Variables" .IX Subsection "Variables" To simplify the mind-numbingly complex rules of declension and conjugation that govern inflexions in Latin, Perligata treats all user-defined scalar and array variables as neuter nouns of the second declension \*(-- singular for scalars, plural for arrays. .PP Hashes represent something of a difficulty in Perligata, as Latin lacks an obvious way of distinguishing these \*(L"plural\*(R" variables from arrays. The solution that has been adopted is to depart from the second declension and represent hashes as masculine plural nouns of the fourth declension. .PP Hence, the type and role of all types variables are specified by their number and case. .PP When elements of arrays and hashes are referred to directly in Perl, the prefix of the container changes from \f(CW\*(C`@\*(C'\fR or \f(CW\*(C`%\*(C'\fR to \f(CW\*(C`$\*(C'\fR. So it should not be surprising that Perligata also makes use of a different inflexion to distinguish these cases. .PP Indexing operations such as \f(CW$array[$elem]\fR or \f(CW$hash{$key}\fR might be translated as \*(L"elem of array\*(R" or \*(L"key of hash\*(R". This suggests that when arrays or hashes are indexed, their names should be rendered in the genitive (or possessive) case. Multi-level indexing operations (\f(CW$array[$row][$column]\fR) mean \*(L"column of row of array\*(R", and hence the first indexing variable must also be rendered in the genitive. .PP Note that the current release of Perligata only supports homogeneous multi-level indexing. That is: \f(CW$lol[$row][$column]\fR or \&\f(CW$hoh{key}{subkey}{subsubkey}\fR, but not \f(CW$lohol[$index1]{key}[$index2]\fR. .PP The rules for specifying variables may be summarized as follows: .PP .Vb 11 \& Perligata Number, Case, and Declension Perl Role \& ========= ============================ ==== ==== \& nextum accusative singular 2nd $next scalar rvalue \& nexta accusative plural 2nd @next array rvalue \& nextus accusative plural 4th %next hash rvalue \& nexto dative singular 2nd $next scalar lvalue \& nextis dative plural 2nd @next array lvalue \& nextibus dative plural 4th %next hash lvalue \& nexti genitive singular 2nd [$next]... scalar index \& nextorum genitive plural 2nd $next[...] array element \& nextuum genitive plural 4th $next{...} hash entry .Ve .PP In other words, scalars are always singular nouns, arrays and hashes are always plural (but of different declensions), and the case of the noun specifies its syntactic role in a statement : accusative for an rvalue, dative for an lvalue, genitive when being index. Of course, because the inflection determines the syntactic role, the various components of a statement can be given in any order. For example, the Perl statement: .PP .Vb 1 \& $last = $next; .Ve .PP could be expressed in Perligata as any of the following (\f(CW\*(C`da\*(C'\fR is the Perligata assignment operator \*(-- see \*(L"Built-in functions and operators\*(R"): .PP .Vb 6 \& lasto da nextum. \& lasto nextum da. \& nextum da lasto. \& nextum lasto da. \& da lasto nextum. \& da nextum lasto. .Ve .PP The special form \f(CW$#array\fR is rendered via the Perligata verb \fIadmeta\fR (\*(L"measure out\*(R"). See \*(L"Subroutines, operators, and functions\*(R". .PP The common punctuation variables \f(CW$_\fR and \f(CW@_\fR are special cases. \&\f(CW$_\fR is often the value under implicit consideration (e.g. in pattern matches, or \f(CW\*(C`for\*(C'\fR loops) and so it is rendered as \*(L"this thing\*(R": \fIhoc\fR as an rvalue, \fIhuic\fR as an lvalue, \fIhuius\fR used as an intermediate index. .PP Similarly, \f(CW@_\fR is implicitly the list of things passed into a subroutine, and so is rendered as \*(L"these things\*(R": \fIhaec\fR as an rvalue, \&\fIhis\fR as an lvalue, \fIhorum\fR when indexed. .PP Other punctuation variables take the Latin forms of their English.pm equivalents (see \*(L"\s-1THESAURUS PERLIGATUS\*(R"\s0), often with a large measure of poetic licence. For example, in Perligata, \f(CW$/\fR is rendered as \&\fIianitorem\fR or \*(L"gatekeeper\*(R". .PP The \*(L"numeral\*(R" variables \*(-- \f(CW$1\fR, \f(CW$2\fR, etc. \*(-- are rendered as synthetic compounds: \fIparprimum\fR (\*(L"the equal of the first\*(R"), \&\fIparsecundum\fR (\*(L"the equal of the second\*(R"), etc. When used as interim indices, they take their genitive forms: \&\fIparprimi\fR, \fIparsecundi\fR, etc. Since they cannot be used as an lvalue, they have no dative forms. .ie n .SS """my"", ""our"", and ""local""" .el .SS "\f(CWmy\fP, \f(CWour\fP, and \f(CWlocal\fP" .IX Subsection "my, our, and local" In Perligata, the \f(CW\*(C`my\*(C'\fR modifier is rendered \*(-- not surprisingly \*(-- by the first person possessive pronouns: \fImeo\fR (conferring a scalar context) and \fImeis\fR (for a list context). Note that the modifier is always applied to a dative (lvalue), and hence is itself declined in that case. Thus: .PP .Vb 3 \& meo varo haec da. # my $var = @_; \& meis varo haec da. # my ($var) = @_ \& meis varis haec da. # my @var = @_; .Ve .PP Similarly the \f(CW\*(C`our\*(C'\fR modifier is rendered as \fInostro\fR or \fInostris\fR, depending on the desired context. .PP The Perl \f(CW\*(C`local\*(C'\fR modifier is \fIloco\fR or \fIlocis\fR in Perligata: .PP .Vb 3 \& loco varo haec da. # local $var = @_; \& locis varo haec da. # local ($var) = @_ \& locis varis haec da. # local @var = @_; .Ve .PP This is particularly felicitous: not only is \fIloco\fR the Latin term from which the word \*(L"local\*(R" derives, it also means \*(L"in place of\*(R" (as in: \&\fIin loco parentis\fR). This meaning is much closer to the actual behaviour of the \f(CW\*(C`local\*(C'\fR modifier, namely to temporarily install a new symbol table entry in place of the current one. .SS "Subroutines, operators, and functions" .IX Subsection "Subroutines, operators, and functions" Functions, operators, and user-defined subroutines are represented as verbs or, in some situations, verbal nouns. The inflexion of the verb determines not only its syntactic role, but also its call context. .PP User-defined subroutines are the simplest group. To avoid ambiguities, they are all treated as verbs of the third conjugation. For example, here are the various conjugations for different usages for a user-defined subroutine \f(CW\*(C`count()\*(C'\fR: .PP .Vb 8 \& Perligata Number, Mood, etc Perl Role Context \& ========= ================= ==== ==== ======= \& countere infinitive sub count defn \- \& counte imperative sing. count() call void \& countementum acc. sing. resultant count() call scalar \& countementa acc. plur. resultant count() call list \& countemento dat. sing. resultant count() call scalar lvalue \& countementis dat. plur. resultant count() call list lvalue .Ve .PP The use of the infinitive as a subroutine definition is obvious: \&\fIaccipere\fR would tell Perligata how \*(L"to accept\*(R"; \fIspernere\fR, how \*(L"to reject\*(R". So \fIcountere\fR specifies how \*(L"to count\*(R". .PP The use of the imperative for void context is also straightforward: \&\fIaccipe\fR commands Perligata to \*(L"accept!\*(R", \fIsperne\fR tells it to \&\*(L"reject!\*(R", and \fIcounte\fR bids it \*(L"count!\*(R". In each case, an instruction is being given (and in a void context too, so no backchat is expected). .PP Handling scalar and list contexts is a little more challenging. The corresponding Latin must still have verbal properties, since an action is being performed upon objects. But it must also have the characteristics of a noun, since the result of the call will itself be used as the object (i.e. target or data) of some other verb. Fortunately, Latin has a rich assortment of verbal nouns \*(-- far more than English \*(-- that could fill this role. .PP Since it is the result of the subroutine call that is of interest here, the chosen solution was to use the \fI\-ementum\fR suffix, which specifies the (singular, accusative) outcome of an action. This corresponds to the result of a subroutine called in a scalar context and used as data. For a list data context, the plural suffix \fI\-ementa\fR is used, and for targets, the dative forms are used: \fI\-emento\fR and \fI\-ementis\fR. Of course, Perl does not (yet) support lvalue subroutines that return a list/array, so the \fI\-mentis\fR suffix currently triggers an error. .PP Note that these resultative endings are completely consistent with those for variables. .SS "Built-in functions and operators" .IX Subsection "Built-in functions and operators" Built-in operators and functions could have followed the same \&\*(L"dog-latin\*(R" pattern as subroutines. For example \f(CW\*(C`shift\*(C'\fR might have been \fIshifte\fR in a void context, \fIshiftementa\fR when used as data in an array context, \fIshiftemento\fR when used as a target in a scalar context, etc. .PP However, Latin already has a perfectly good verb with the same meaning as \&\f(CW\*(C`shift\*(C'\fR: \fIdecapitare\fR (\*(L"to behead\*(R"). Unfortunately, this verb is of the first conjugation, not the second, and hence has the imperative form \fIdecapita\fR, which makes it look like a Perligata array in a data role. .PP Orthogonality has never been Perl's highest design criterion, so Perligata follows suit by eschewing bland consistency in favour of aesthetics. All Perligata keywords \*(-- including function and operator names \*(-- are therefore specified as correct Latin verbs, of whatever conjugation is required. For example: .PP .Vb 7 \& Operator/ Literal In void When used as When used as \& function meaning context scalar rvalue list rvalue \& ======== ======= ======= ============= ============ \& + "add" adde addementum addementa \& = "give" da damentum damenta \& . "conjoin" sere serementum serementa \& .. "enlist" conscribe conscribementum conscribementa \& \& shift "behead" decapita decapitamentum decapitamenta \& \& push "stack" cumula cumulamentum cumulamenta \& pop "unstack" decumula decumulamentum decumulamenta \& \& grep "winnow" vanne vannementum vannementa \& print "write" scribe scribementum scribementa \& write "write below" subscribe subscribementum subscribementa \& \& die "die" mori morimentum morimenta .Ve .PP The full list of Perligata keywords is provided in \*(L"\s-1THESAURUS PERLIGATUS\*(R"\s0. .PP Note, however, that consistency has not been entirely forsaken. The back-formations of inflexions for scalar and list context are entirely regular, and consistent with those for user-defined subroutines (described above). .PP A few Perl built-in functions \*(-- \f(CW\*(C`pos\*(C'\fR, \f(CW\*(C`substr\*(C'\fR, \f(CW\*(C`keys\*(C'\fR \*(-- can be used as lvalues. That is, they can be the target of some other action (typically of an assignment). In Perligata such cases are written in the dative singular (since the lvalues are always scalar). Note too that, because an assignment to an lvalue function modifies its first argument, that argument must be a target too, and hence must be written in the dative as well. .PP Thus: .PP .Vb 2 \& nexto stringum reperimentum da. # $next = pos $string; \& nextum stringo reperimento da. # pos $string = $next; \& \& inserto stringum tum unum tum duo excerpementum da. \& # $insert = substr($string,1,2); \& insertum stringo unum tum duo excerpemento da. \& # substr($string,1,2) = $insert; \& \& clavis hashus nominamentum da. # @keys = keys %hash; \& clava hashibus nominamento da. # keys %hash = @keys; .Ve .PP An interesting special case is the \f(CW$#array\fR construction, which in Perligata is rendered via the verb \fIadmeta\fR: .PP .Vb 1 \& counto da arraya admetamentum. # $count = $#array; .Ve .SS "Comments" .IX Subsection "Comments" In Perligata, comments are rendered by the verb \fIadnota\fR (\*(L"annotate\*(R") and extend until the end of the line. For example: .PP .Vb 1 \& nexto da prevum. adnota mensuram antiquam reserva .Ve .PP means: .PP .Vb 1 \& $next = $prev; # remember old amount .Ve .SS "Imposing precedence on argument lists" .IX Subsection "Imposing precedence on argument lists" The order-independence of argument lists and subroutine calls largely makes up for the lack of bracketing in Perligata. For example, the Perl statement: .PP .Vb 1 \& $res = foo(bar($xray,$yell),$zip); .Ve .PP can be written: .PP .Vb 1 \& reso da xrayum tum yellum barmentum tum zipum foomentum. .Ve .PP Note that the lack of argument list brackets in Perligata means that if it were written: .PP .Vb 1 \& reso da foomentum barmentum xrayum tum yellum tum zipum. .Ve .PP it would be equivalent to: .PP .Vb 1 \& $res = foo(bar($xray,$yell,$zip)); .Ve .PP instead. .PP Likewise, it is possible to translate: .PP .Vb 1 \& $res = foo($xray,bar($yell,$zip)); .Ve .PP like so: .PP .Vb 1 \& reso da xrayum tum barmentum yellum tum zipum foomentum. .Ve .PP But translating: .PP .Vb 1 \& $res = foo($weld,bar($xray,$yell),$zip); .Ve .PP presents a difficulty. .PP In the first example above (\fIxrayum tum yellum barmentum tum zipum foomentum\fR), the verb \fIbarmentum\fR was used as a suffix on \fIxrayum tum yellum\fR \*(-- to keep the variable \fIzipum\fR out of the argument list of the call to \f(CW\*(C`bar\*(C'\fR. In the second example (\fIxrayum tum barmentum yellum tum zipum foomentum\fR), the verb \&\fIbarmentum\fR was used as a prefix on \fIyellum tum zipum\fR \*(-- to keep the variable \fIxrayum\fR out of the argument list. .PP But in this third example, it's necessary to keep both \fIweldum\fR and \fIzipum\fR out of \f(CW\*(C`bar\*(C'\fR's argument list. Unfortunately, \fIbarmentum\fR can't be both a prefix (to isolate \fIweldum\fR) and a suffix (to isolate \fIzipum\fR) simultaneously. .PP The solution is to use the preposition \fIcum\fR (meaning \*(L"with...\*(R") at the start of \f(CW\*(C`bar\*(C'\fR's argument list, with \fIbarmentum\fR as a suffix at the end of the list: .PP .Vb 1 \& reso da foomentum weldum tum cum xrayum tum yellum barmentum tum zipum. .Ve .PP It is always permissible to specify the start of a nested argument list with a \fIcum\fR, so long as the governing verb is used as a suffix. .SS "Blocks and control structures" .IX Subsection "Blocks and control structures" Natural languages generally use some parenthetical device \*(-- such as parentheses, commas, or (as here) dashes \*(-- to group and separate collections of phrases or statements. .PP Some such mechanism would be an obvious choice for denoting Perligata code blocks, but there is a more aesthetically pleasing solution. Perl's block delimiters (\f(CW\*(C`{\*(C'\fR..\f(CW\*(C`}\*(C'\fR) have two particularly desirable properties: they are individually short, and collectively symmetrical. It was considered important to retain those characteristics in Perligata. .PP In Latin, the word \fIsic\fR has a sense that means \*(L"as follows\*(R". Happily, its contranym, \fIcis\fR, has the meaning (among others) \&\*(L"to here\*(R". The allure of this kind of wordplay being impossible to resist, Perligata delimits blocks of statements with these two words. For example: .PP .Vb 4 \& sic # { \& loco ianitori. # local $/; \& dato nuntio perlegementum da. # $data = ; \& cis # } .Ve .PP Control structures in Perligata are rendered as conditional clauses, as they are in Latin, English, and Perl. And as in those other languages, they may precede or follow the code blocks they control. .PP Perligata provides the following control structures: .PP .Vb 11 \& Perligata Perl \& ========= ==== \& si ... fac if ... \& nisi ... fac unless ... \& dum ... fac while ... \& donec ... fac until ... \& per (quisque) ... in ... fac for(each) ... \& posterus next \& ultimus last \& reconatus redo \& confectus continue .Ve .PP The trailing \fIfac\fR is the imperative form of \fIfacere\fR (\*(L"to do\*(R") and is used as a delimiter on the control statement's condition. It is required, regardless of whether the control statement precedes or follows its block. .PP The choice of \fIdum\fR and \fIdonec\fR is completely arbitrary, since Latin does not distinguish \*(L"while\*(R" and \*(L"until\*(R" as abstractions in the way English does. \fIDum\fR and \fIdonec\fR each mean both \*(L"while\*(R" and \*(L"until\*(R", and Latin relies on context (i.e. semantics) to distinguish them. This is impractical for Perligata, so it always treats \fIdum\fR as \f(CW\*(C`while\*(C'\fR and \&\fIdonec\fR as \f(CW\*(C`until\*(C'\fR. This choice was made in order to favour the shorter term for the more common type of loop. .PP The choice of \fIconfectus\fR for \f(CW\*(C`continue\*(C'\fR seeks to convey the function of the control structure, not the literal meaning of the English word. That is, a \f(CW\*(C`continue\*(C'\fR block specifies how to complete (\fIconficere\fR) an iteration. .PP Perligata only supports the pure iterative form of \f(CW\*(C`for(each)\*(C'\fR, not the C\-like three-part syntax. .PP Because: .PP .Vb 1 \& foreach $var (@list) {...} .Ve .PP means \*(L"for each variable in the list...\*(R", the scalar variable must be in the accusative (as it is governed by the preposition \*(L"for\*(R"), and the list must be in the ablative (denoting inclusion). Fortunately, in the second declension, the inflexion for ablatives is exactly the same as for datives, giving: .PP .Vb 1 \& per quisque varum in listis sic ... cis .Ve .PP This means that no extra inflexions have to be learned just to use the \&\fIper\fR loop. Better still, the list (\fIlistis\fR) looks like a Perligata array variable in a target role, which it clearly is, since its contents may be modified within the loop. .PP Note that you can also omit the accusative variable completely: .PP .Vb 1 \& per quisque in listis sic ... cis .Ve .PP and leave \fIhoc\fR (\f(CW$_\fR) implied, as in regular Perl. .SS "Data" .IX Subsection "Data" The \f(CW\*(C`_\|_END_\|_\*(C'\fR and \f(CW\*(C`_\|_DATA_\|_\*(C'\fR markers in Perligata are \fIfinis\fR (\*(L"boundary\*(R") and \fInuntius\fR (\*(L"information\*(R") respectively. Data specified after either of these markers is available via the input stream \&\fInuntio\fR. For example: .PP .Vb 10 \& dum perlege nuntio fac sic # while () { \& scribe egresso hoc. # print $_; \& cis # } \& # \& finis # _\|_END_\|_ \& post # post \& hoc # hoc \& ergo # ergo \& propter # propter \& hoc # hoc .Ve .SS "Numbers" .IX Subsection "Numbers" Numeric literals in Perligata are rendered by Roman numerals \*(-- \fII\fR, \&\fI\s-1II\s0\fR, \fI\s-1III\s0\fR, \fI\s-1IV\s0\fR...\fI\s-1XV\s0\fR...\fI\s-1XLII\s0\fR, etc, up to \&\fI(((((((I)))))))((((((((I))))))))((((((I))))))(((((((I)))))))(((((I)))))((((((I))))))((((I))))(((((I)))))(((I)))((((I))))((I))(((I)))M((I))CMXCIX\fR (that is: 9,999,999,999) .PP The digits are: .PP .Vb 10 \& Roman Arabic \& ===== ====== \& I 1 \& V 5 \& X 10 \& L 50 \& C 100 \& D 500 \& M 1,000 \& I)) 5,000 \& ((I)) 10,000 \& I))) 50,000 \& (((I))) 100,000 \& I)))) 500,000 \& ((((I)))) 1,000,000 \& I))))) 5,000,000 \& (((((I))))) 10,000,000 \& I)))))) 500,000,000 \& ((((((I)))))) 1,000,000,000 \& I))))))) 5,000,000,000 \& (((((((I))))))) 10,000,000,000 .Ve .PP The value \fI((I))\fR is 10,000 and every additional pair of \fIapostrophi\fR (rendered as parentheses in \s-1ASCII\s0) multiply that value by 10. .PP Notice that those wacky Romans literally used \*(L"half\*(R" of each big number (e.g. \fII))\fR, \fII)))\fR, etc.) to represent half of each big numbers (i.e. 5000, 50000, etc.) .PP The first 10 numbers may also be referred to by name: \&\fIunum\fR/\fIunam\fR, \fIduo\fR/\fIduas\fR, \fItres\fR, \fIquattuor\fR, \fIquinque\fR, \&\fIsex\fR, \fIseptem\fR, \fIocto\fR, \fInovem\fR, \fIdecem\fR. Zero, for which there is no Latin numeral, is rendered by \fInullum\fR (\*(L"no-one\*(R"). \fINihil\fR (\*(L"nothing\*(R") might have been a closer rendering, but it is indeclinable and hence indistinguishable in the accusative and genitive. .PP When a numeric literal is used in an indexing operation, it must be an ordinal: \*(L"zeroth (element)\*(R", \*(L"first (element)\*(R", \*(L"second (element)\*(R", etc. .PP The first ten ordinals are named (in the accusative): \fIprimum\fR/\fIprimam\fR, \&\fIsecundum\fR/\fIsecundam\fR, \fItertium\fR/\fItertiam\fR, \fIquartum\fR/\fIquartam\fR, \&\fIquintum\fR/\fIquintam\fR, \fIsextum\fR/\fIsextam\fR, \fIseptimum\fR/\fIseptimam\fR, \&\fIoctavum\fR/\fIoctavam\fR, \fInonum\fR/\fInonam\fR, \fIdecimum\fR/\fIdecimam\fR. Ordinals greater than ten are represented by their corresponding numeral with the suffix \fI\-imum\fR: \fIXVimum\fR (\*(L"15th\*(R"), \fIXLIIimum\fR (\*(L"42nd\*(R"), etc. By analogy, ordinal zero is rendered by the invented form \fInullimum\fR. .PP If the element being indexed is used as an lvalue, then the ordinal must of course be in the dative instead: \fInullimo\fR, \fIprimo\fR, \fIsecundo\fR, \&\fItertio\fR, \fIquarto\fR, \fIquinto\fR, \fIsexto\fR, \fIseptimo\fR, \fIoctavo\fR, \&\fInono\fR, \fIdecimo\fR, \fIXIimo\fR, etc. Note that the feminine dative forms are \fInot\fR available in Perligata, as they are ambiguous with the feminine genitive singular forms. .PP In a multi-level indexing operation, ordinals may need to be specified in the genitive: \fInulli\fR/\fInullae\fR, \fIprimi\fR/\fIprimae\fR, \&\fIsecundi\fR/\fIsecundae\fR, \fItertii\fR/\fItertiae\fR...\fIXVimi\fR/\fIXVimae\fR, etc. .PP For example: .PP .Vb 1 \& $unimatrix[1][3][9][7]; .Ve .PP would be: .PP .Vb 1 \& septimum noni tertii primi unimatrixorum .Ve .PP which is literally: .PP .Vb 1 \& seventh of ninth of third of first of unimatrix .Ve .PP Note that the order of the genitives is significant here, and is the reverse of that required in Perl. .PP As mentioned in \*(L"Variables\*(R", Perligata currently only supports homogeneous multi-level indexing. If the final genitive indicates an array (e.g. \fIunimatrixorum\fR in the previous example), then preceding index is assumed to be an array index. If the final genitive indicates a hash, every preceding genitive, and the original ordinal are presumed to be keys. For example: .PP .Vb 2 \& septimum noni tertii primi unimatrixorum # $unimatrix[1][3][9][7]; \& septimum noni tertii primi unimatrixuum # $unimatrix{1}{3}{9}{7}; .Ve .PP Floating point numbers are expressed in Perligata as Latin fractions: .PP .Vb 2 \& unum quartum # 0.25 \& MMMCXLI Mimos # 3.141 .Ve .PP Note that the numerator is always a cardinal and the denominator a (singular or plural) ordinal (\*(L"one fourth\*(R", \*(L"3141 1000ths\*(R"). The plural of a Latin accusative ordinal is formed by replacing the \fI\-um\fR suffix by \&\fI\-os\fR. This nicety can be ignored, as Perligata will accept fractions in the form \fI\s-1MMMCXLI\s0 Mimum\fR (\*(L"3141 1000th\*(R") .PP Technically, both numerator and denominator should also be in the feminine gender \*(-- \fIuna quartam\fR, \fI\s-1MMMCXLI\s0 Mimas\fR. This Latin rule is not enforced in Perligata (to help minimize the number of suffixes that must be remembered), but Perligata \fIdoes\fR accept the feminine forms. .PP Perligata outputs numbers in Arabic, but the verb \fIcome\fR (\*(L"beautify\*(R") may be used to convert numbers to proper Roman numerals: .PP .Vb 3 \& per quisque in I tum C conscribementum sic \& hoc tum duos multiplicamentum comementum egresso scribe. \& cis .Ve .SS "Strings" .IX Subsection "Strings" Classical Latin does not use punctuation to denote direct quotation. Instead the verb \fIinquit\fR (\*(L"said\*(R") is used to report a direct utterance. Hence in Perligata, a literal character string is constructed, not with quotation marks, but by invoking the verbal noun \&\fIinquementum\fR (\*(L"the result of saying\*(R"), with a data list of literals to be interpolated. For example: .PP .Vb 1 \& print STDOUT \*(AqEnter next word:\*(Aq; .Ve .PP becomes: .PP .Vb 1 \& Enter tum next tum word inquementum tum biguttam egresso scribe. .Ve .PP Note that the arguments to \fIinquementum\fR are special, in that they are treated as literals. Punctuation strings have special names, such as \&\fIlacunam\fR (\*(L"a hole\*(R") for space, \fIstadium\fR (\*(L"a stride\*(R") for tabspace, \&\fInovumversum\fR (\*(L"new verse\*(R") for newline, or \fIbiguttam\fR (\*(L"two spots\*(R") for colon. .PP It is also possible to directly quote a series of characters (as if they were inside a \f(CW\*(C`q{...}\*(C'\fR. The Perligata equivalent is a \fIdictum sic...cis\fR: .PP .Vb 1 \& sic Enter next word : cis dictum egresso scribe. .Ve .PP or: .PP .Vb 1 \& dictum sic Enter next word : cis egresso scribe. .Ve .PP \&\f(CW\*(C`dictum\*(C'\fR is, of course, a contraction of \f(CW\*(C`dicementum\*(C'\fR (\*(L"the result of saying\*(R"), and Perligata allows this older form as well. .PP Perligata does not provide an interpolated quotation mechanism. Instead, variables must be concatenated into a string. So: .PP .Vb 2 \& print STDERR "You entered $word\en"; \& $mesg = "You entered $word"; .Ve .PP becomes: .PP .Vb 2 \& You tum entered inquementum tum wordum tum novumversum oraculo scribe. \& mesgo da You tum entered inquementum tum wordum serementum. .Ve .SS "Regular expressions" .IX Subsection "Regular expressions" \&\fB\f(BI[Perligata's regular expression mechanism is not yet implemented. This section outlines how it will work in a future release.]\fB\fR .PP In Perligata, patterns will be specified in a constructive syntax (as opposed to Perl's declarative approach). Literals will regular strings and other components of a pattern will be adjectives, verbs, nouns, or a connective: .PP .Vb 10 \& Perl Perligata Meaning \& ==== ========= ======= \& ...+? multum "many" \& ...+ plurissimum "most" \& ...?? potis "possible" \& ...? potissimum "most possible" \& (...) captivum "captured" \& (?=...) excuba "keep watch" \& [...] opta "choose between" \& . quidlibet "anything" \& \ed digitum "a finger" \& \es lacunam albam "a white space" \& \ew litteram "a character" \& | an interrogative "or" .Ve .PP The final pattern will be produced using the supine \fIdesideratum\fR. For example: .PP .Vb 3 \& pato da desideratum # $pat = qr/(?x) \& C tum plurissimum A tum O opta tum T # C[AO]+T \& an DOG tum potissimum GY. # |DOG(?:GY)?/; .Ve .PP Actual matching against a pattern will be done via the \fIcompara\fR (\*(L"match\*(R") and \fIsubstitue\fR (\*(L"substitute\*(R") verbs: .PP .Vb 3 \& si stringum patum comparamentum fac sic # if ($string =~ /$pat/) { \& scribe egresso par inquementum # print "match" \& cis # \& \& \& huic substitue patum tum valum # s/$pat/$val/ \& per quisque in listis. # foreach @list; .Ve .PP Note that the string being modified by \fIsubstitue\fR will have to be dative. .SS "References" .IX Subsection "References" To create a reference to a variable, the variable is written in the ablative (which looks exactly like the dative in Perligata's restricted Latin syntax) and prefaced with the preposition \fIad\fR (\*(L"to\*(R"). To create a reference to a subroutine, the associated verb is inflected with the accusative suffix \fI\-torem\fR (\*(L"one who...\*(R") to produce the corresponding noun-of-agency. .PP For example: .PP .Vb 3 \& val inquemento hashuum ad dato da. # $hash{\*(Aqval\*(Aq} = \e$dat; \& arg inquemento hashuum ad argis da. # $hash{\*(Aqarg\*(Aq} = \e@arg; \& act inquemento hashuum functorem da. # $hash{\*(Aqact\*(Aq} = \e&func; \& \& ad val inquemento hashuum dato da. # $dat = \e$hash{\*(Aqval\*(Aq}; \& ad inquemento arg hashuum argis da. # @arg = \e$hash{\*(Aqarg\*(Aq}; \& funcemento da ad inquemento act hashuum. # func() = \e$hash{\*(Aqact\*(Aq}; .Ve .PP A special case of this construction is the anonymous subroutine constructor \fIfactorem\fR (\*(L"one who does...\*(R"), which is the equivalent of \&\f(CW\*(C`sub {...}\*(C'\fR in Perl: .PP .Vb 1 \& anonymo da factorem sic haec mori cis. # $anon = sub { die @_ }; .Ve .PP As in Perl, such subroutines may be invoked by concatenating a call specifier to the name of the variable holding the reference: .PP .Vb 1 \& anonymume nos tum morituri inquementum. # &$anon(\*(AqNos morituri\*(Aq); .Ve .PP Note that the variable holding the reference (\fIanonymum\fR) is being used as data, so it is named in the accusative. .PP In the few cases where a subroutine reference can be the target of an action, the dative suffix (\fI\-tori\fR) is used instead: .PP .Vb 2 \& benedictum functori classum. # bless \e&func, $class; \& benedictum factori sic mori cis classum. # bless sub{die}, $class; .Ve .PP To dereference other types of references, a resultative of the verb \fIarcesse\fR (\*(L"fetch\*(R") is used: .PP .Vb 5 \& Ref type Perligata Perl Context \& ======== ========= ==== ======= \& scalar arcessementum varum $$var rvalue \& scalar arcessemento varum $$var lvalue \& array arcessementi varum ...[$$var] rvalue \& \& array arcessementa varum @$var rvalue \& array arcessementis varum @$var lvalue \& array arcessementorum varum $var\->[...] either \& \& hash arcessementus varum %$var rvalue \& hash arcessementibus varum %$var lvalue \& array arcessementuum varum $var\->{...} either .Ve .PP Note that the first six forms are just the standard resultatives (in accusative, dative, and genitive) for the regular Perligata verb \&\fIarcesse\fR. The last three forms are ungrammatical inflections (\fI\-mentum\fR is 2nd declension, not 4th), but are plausible extensions of the resultative to denote a hash return value. .PP Multiple levels of dereferencing are also possible: .PP .Vb 1 \& valo da arcessementa arcessementum varum # $val = @$$var; .Ve .PP as is appropriate indexing (using the genitive forms): .PP .Vb 3 \& valo da primum varum arcessementorum # $val = $var\->[1]; \& valo da primum varum arcessementuum # $val = $var\->{1}; \& valo da primum varum arcessementi arrorum # $val = $arr[$$var][1]; .Ve .SS "Boolean logic" .IX Subsection "Boolean logic" Perl's logical conjunctive and disjunctive operators come in two precedences, and curiously, so do those of Latin. The higher precedence Perl operators \*(-- \&\f(CW\*(C`&&\*(C'\fR and \f(CW\*(C`||\*(C'\fR \*(-- are represented in Perligata by the emphatic Latin conjunctions \fIatque\fR and \fIvel\fR respectively. The lower precedence operators \*(-- \f(CW\*(C`and\*(C'\fR and \f(CW\*(C`or\*(C'\fR \*(-- are represented by the unemphatic conjunctive suffixes \fI\-que\fR and \fI\-ve\fR. Hence: .PP .Vb 4 \& reso damentum foundum atque runementum. # $res = $found && run(); \& reso damentum foundum runementumque. # $res = $found and run(); \& reso damentum foundum vel runementum. # $res = $found || run(); \& reso damentum foundum runementumve. # $res = $found or run(); .Ve .PP Note that, as in Latin, the suffix of the unemphatic conjunction is always appended to the first word after the point at which the conjunction would appear in English. Thus: .PP .Vb 1 \& $result = $val or max($1,$2); .Ve .PP is rendered as: .PP .Vb 1 \& resulto damentum valum parprimumve tum parsecundum maxementum. .Ve .PP or: .PP .Vb 1 \& resulto damentum valum maxementumve parprimum tum parsecundum. .Ve .PP Proper Latinate comparisons would be odious in Perligata, because they require their first argument to be expressed in the nominative and would themselves have to be indicative. This would, of course, improve the positional independence of the language even further, allowing: .PP .Vb 3 \& si valus praecedit datum... # if $val < $dat... \& si praecedit datum valus... # if $val < $dat... \& si datum valus praecedit... # if $val < $dat... .Ve .PP Unfortunately, it also introduces another set of case inflexions and another verbal suffix. Worse, it would mean that noun suffixes are no longer unambiguous. In the 2nd declension, the nominative plural ends in the same \fI\-i\fR as the genitive singular, and the nominative singular ending (\fI\-us\fR) is the same as the accusative plural suffix for the fourth declension. So if nominatives were used, scalars could no longer always be distinguished from arrays or from hashes, except by context. .PP To avoid these problems, Perligata represents the equality and simple inequality operators by three pairs of verbal nouns: .PP .Vb 8 \& Perligata Meaning Perl \& ========= ======= ==== \& aequalitam "equality (of...)" == \& aequalitas "equalities (of...)" eq \& praestantiam "precedence (of...)" < \& praestantias "precedences (of...)" lt \& comparitiam "comparison (of...)" <=> \& comparitias "comparisons (of...)" cmp .Ve .PP Each operator takes two data arguments, which it compares: .PP .Vb 3 \& si valum tum datum aequalitam # si $val == $dat \& si valum tum datum praestantias # si $val lt $dat \& si aum tum bum comparitiam # si $a <=> $b .Ve .PP The effects of the other comparison operators \*(-- \f(CW\*(C`>\*(C'\fR, \f(CW\*(C`<=\*(C'\fR, \&\f(CW\*(C`!=\*(C'\fR, \f(CW\*(C`ne\*(C'\fR, \f(CW\*(C`ge\*(C'\fR, etc. \*(-- are all achieved by appropriate ordering of the two arguments and combination with the the logical negation operator \&\fInon\fR: .PP .Vb 3 \& si valum tum datum non aequalitam # if $val != $dat \& si datum tum valum praestantiam # if $val > $dat \& si valum non praestantias datum # if $val ge $dat .Ve .SS "Packages and classes" .IX Subsection "Packages and classes" The Perligata keyword to declare a package is \fIdomus\fR, literally \&\*(L"the house of\*(R". In this context, the name of the class follows the keyword and is treated as a literal; as if it were the data argument of an \&\fIinquementum\fR. .PP To explicitly specify a variable or subroutine as belonging to a package, the preposition \fIintra\fR (\*(L"within\*(R") is used. To call a subroutine as a method of a particular package (or of an object), the preposition \fIapud\fR (\*(L"of the house of\*(R") is used. Thus \fIintra\fR is Perligata's \f(CW\*(C`::\*(C'\fR and \fIapud\fR is it's \f(CW\*(C`\->\*(C'\fR. .PP The Perl \f(CW\*(C`bless\*(C'\fR function is \fIbenedice\fR in Perligata, but almost invariably used in the scalar accusative form \fIbenedicementum\fR. Perligata also understands the correct (contracted) Latin form of this verb: \fIbenedictum\fR. .PP Thus: .PP .Vb 1 \& domus Specimen. # package Specimen; \& \& newere # sub new \& sic # { \& meis datibus. # my %data; \& counto intra Specimen \& postincresce. # $Specimen::count++; \& datibus primum horum benedictum. # bless \e%data, $_[0]; \& cis # } \& \& printere # sub print \& sic # { \& modus tum indefinitus inquementum mori. # die \*(Aqmethod undefined\*(Aq; \& cis # } \& \& domus princeps. # package main; \& \& meo objecto da # my $object = \& newementum apud Specimen. # Specimen\->new; \& \& printe apud objectum; # $object\->print; .Ve .SH "THESAURUS PERLIGATUS" .IX Header "THESAURUS PERLIGATUS" This section lists the complete Perligata vocabulary, except for Roman numerals (\fII\fR, \fI\s-1II\s0\fR, \fI\s-1III\s0\fR, etc.) .PP In each of the following tables, the three columns are always the same: \&\*(L"Perl construct\*(R", \*(L"Perligata equivalent\*(R", \*(L"Literal meaning of Perligata equivalent\*(R". .PP Generally, only the accusative form is shown for nouns and adjectives, and only the imperative for verbs. .SS "Values and variables" .IX Subsection "Values and variables" .Vb 10 \& 0 nullum "no\-one" \& 1 unum "one" \& 2 duo "two" \& 3 tres "three" \& 4 quattuor "four" \& 5 quinque "five" \& 6 sex "six" \& 7 septem "seven" \& 8 octo "eight" \& 9 novem "nine" \& 10 decem "ten" \& [0] nullimum "zeroth" \& [1] primum "first" \& [2] secundum "second" \& [3] tertium "third" \& [4] quartum "fourth" \& [5] quintum "fifth" \& [6] sextum "sixth" \& [7] septimum "seventh" \& [8] octavum "eighth" \& [9] nonum "ninth" \& [10] decimum "tenth" \& $1 parprimum "equal of the first" \& $2 parsecundum "equal of the first" \& $3 partertium "equal of the third" \& $4 parquartum "equal of the fourth" \& $5 parquintum "equal of the fifth" \& $6 parsextum "equal of the sixth" \& $7 parseptimum "equal of the seventh" \& $8 paroctavum "equal of the eighth" \& $9 parnonum "equal of the ninth" \& $10 pardecimum "equal of the tenth" \& $/ ianitorem "gatekeeper" \& $#var admeta varum "measure out" \& $_ hoc/huic "this thing" \& @_ his/horum "these things" \& ":" biguttam "two spots" \& " " lacunam "a gap" \& "\et" stadium "a stride" \& "\en" novumversum "new line" \& local loco "in place of" \& my meo "my" \& our nostro "our" \& main princeps "principal" .Ve .SS "Quotelike operators" .IX Subsection "Quotelike operators" .Vb 5 \& \*(Aq...\*(Aq inque "say" \& q// inque "say" \& m// compara "match" \& s/// substitue "substitute" \& tr/// converte "translate" .Ve .SS "Mathematical operators and functions" .IX Subsection "Mathematical operators and functions" .Vb 10 \& + adde "add" \& \- deme "subtract" \& \- nega "negate" \& * multiplica "multiply" \& / divide "divide" \& % recide "lop off" \& ** eleva "raise" \& & consocia "unite" \& | interseca "intersect" \& ^ discerne "differentiate (between)" \& ++ preincresce "increase beforehand" \& ++ postincresce "increase afterwards" \& \-\- predecresce "decrease beforehand" \& \-\- postdecresce "decrease afterwards" \& abs priva "strip from" \& atan2 angula "create an angle" \& sin oppone "oppose" \& cos accuba "lie beside" \& int decolla "behead" \& log succide "log a tree" \& sqrt fode "root into" \& rand conice "guess, cast lots" \& srand prosemina "to scatter seed" .Ve .SS "Logical and comparison operators" .IX Subsection "Logical and comparison operators" .Vb 11 \& ! non "general negation" \& && atque "empathic and" \& || vel "emphatic or" \& and \-que "and" \& or \-ve "or" \& < praestantiam "precedence of" \& lt praestantias "precedences of" \& <=> comparitiam "comparison of" \& cmp comparitias "comparisons of" \& == aequalitam "equality of" \& eq aequalitas "equalities of" .Ve .SS "Strings" .IX Subsection "Strings" .Vb 10 \& chomp morde "bite" \& chop praecide "cut short" \& chr inde "give a name to" \& hex senidemi "sixteen at a time" \& oct octoni "eight at a time" \& ord numera "number" \& lc deminue "diminish" \& lcfirst minue "diminish" \& uc amplifica "increase" \& ucfirst amplia "increase" \& quotemeta excipe "make an exception" \& crypt huma "inter" \& length meta "measure" \& pos reperi "locate" \& pack convasa "pack baggage" \& unpack deconvasa "unpack" \& split scinde "split" \& study stude "study" \& index scruta "search" \& join coniunge "join" \& substr excerpe "extract" .Ve .SS "Scalars, arrays, and hashes" .IX Subsection "Scalars, arrays, and hashes" .Vb 10 \& defined confirma "verify" \& undef iani "empty, make void" \& scalar secerna "to distinguish, isolate" \& reset lusta "cleanse" \& pop decumula "unstack" \& push cumula "stack" \& shift decapita "behead" \& unshift capita "crown" \& splice iunge "splice" \& grep vanne "winnow" \& map applica "apply to" \& sort digere "sort" \& reverse retexe "reverse" \& delete dele "delete" \& each quisque "each" \& exists adfirma "confirm" \& keys nomina "name" \& values argue "to disclose the contents" .Ve .SS "I/O" .IX Subsection "I/O" .Vb 10 \& open evolute "open a book" \& close claude "close a book" \& eof extremus "end of" \& read lege "read" \& getc sublege "pick up something" \& readline perlege "read through" \& print scribe "write" \& printf describe "describe" \& sprintf rescribe "rewrite" \& write subscribe "write under" \& pipe inriga "irrigate" \& tell enunta "tell" \& seek conquire "to seek out" \& STDIN vestibulo "an entrance" \& STDOUT egresso "an exit" \& STDERR oraculo "a place were doom is pronounced" \& DATA nuntio "information" .Ve .SS "Control structures" .IX Subsection "Control structures" .Vb 10 \& {...} sic...cis "as follows...to here" \& do fac "do" \& sub {...} factorem sic...cis "one who does ... \& eval aestima "evaluate" \& exit exi "exit" \& for per...in...fac "for...in...do" \& foreach per quisque...in...fac "for each...in...do" \& goto adi "go to" \&