| 1 | THIS FILE IS UNFINISHED !!!! |
| 2 | |
| 3 | |
| 4 | This file is called ABOUT, because it is, well... README, INSTALL, HOWTO, |
| 5 | FAWQ, RTFM and maybe even manual, all in one file. So why not calling it |
| 6 | ABOUT. |
| 7 | |
| 8 | ============================================================================== |
| 9 | Your outside is in: |
| 10 | ============================================================================== |
| 11 | |
| 12 | Well, if you are outside cll1.h... first, forget about all previouse versions of |
| 13 | cll1.h. First of all: the source code should look familiar and readable to |
| 14 | anyone, who have seen anything written in any sane programming language (which |
| 15 | means basicaly anything like Bash, Basic, C, Java, Javascript, Pascal, Perl, |
| 16 | PHP and Python and perhaps lot more). |
| 17 | |
| 18 | Let's see what we have and what you can use: |
| 19 | |
| 20 | 1. This Is The Program - forget int main(...)! |
| 21 | ---------------------- |
| 22 | |
| 23 | #include "cll1.h" |
| 24 | |
| 25 | program {...} |
| 26 | |
| 27 | 2. This Is The String Pointer - just use it. |
| 28 | ----------------------------- |
| 29 | |
| 30 | You don't have to declare "char *_;" - because we have done this for you |
| 31 | automagicaly. In C<<1, this is generic temporary character pointer, which |
| 32 | can be used to anything you need to do with strings. |
| 33 | |
| 34 | 3. This Is The Ouput Statement - no comment :-) |
| 35 | ------------------------------ |
| 36 | |
| 37 | print(string1, string2, ...); |
| 38 | |
| 39 | 3. Dynamic lists - their declaration is complex, but their usage not. |
| 40 | ---------------- |
| 41 | |
| 42 | struct ListType |
| 43 | { |
| 44 | ... |
| 45 | list(ListType); |
| 46 | } *listmemeber,*listhead=NULL; |
| 47 | |
| 48 | create(listmember,ListType); |
| 49 | append(listmember,listhead); |
| 50 | find(listmember,listhead,expression); |
| 51 | remove(listmember,listhead,expression); |
| 52 | sort(listmember,listhead,key,) |
| 53 | |
| 54 | 3. Iterations (cycles) without control variable - can be nested, of course |
| 55 | ----------------------------------------------- |
| 56 | |
| 57 | do {...} loop; |
| 58 | repeat (const int howmanytimes) {...} |
| 59 | |
| 60 | 4. New cool iterators (iteration expresions) for good old FOR cycle |
| 61 | ------------------------------------------------------------------- |
| 62 | |
| 63 | for range (int controlvariable, const int from, const int to) {...} |
| 64 | for each (ListType *controlvariable, ListType *listhead) {...} |
| 65 | for chars (char controlvariable, const char *string) {...} |
| 66 | for lines (char *controlvariable, char *filename) {...} |
| 67 | for flines (char *controlvariable, FILE *filehandle) {...} |
| 68 | |
| 69 | 5. - 6. Undefined - reserved for future use |
| 70 | ----------------- |
| 71 | |
| 72 | 7. Toys - everybody likes toys |
| 73 | ------- |
| 74 | |
| 75 | spam (const int howmanytimes, const char *string); |
| 76 | |
| 77 | 8. Obsolete - but still backwards compatible with previous versions... |
| 78 | ----------- |
| 79 | |
| 80 | every (A,B) {...} -> for each(A,B) {...} |
| 81 | search (A,B,C) {...} -> for each(A,B) if (C) {...} |
| 82 | |
| 83 | 9. Then Buddhism - you can use then, and, or, not and TRUE/FALSE constants. |
| 84 | ---------------- |
| 85 | |
| 86 | if (expression) then {...} else {...} |
| 87 | if (not expression or expression and expression) then {...} else {...} |
| 88 | |
| 89 | ...if you wish, THEN you can. Forget about C, if you don't like it. |
| 90 | |
| 91 | if (expression) {...} else {...} |
| 92 | if (! expression || expression && expression) {...} else {...} |
| 93 | |
| 94 | ...if you don't wish, you don't have to. Go back to the C, if you want. |
| 95 | |
| 96 | ============================================================================== |
| 97 | Your inside is out: |
| 98 | ============================================================================== |
| 99 | |
| 100 | If you are inside l1.h... first, forget about all previouse versions of |
| 101 | cll1.h. I have changed lot of things dramaticaly. First of all, I found out, |
| 102 | that I really have to learn C basics first, before I can attempt to write |
| 103 | set of C language macros. C<<1 until version cca 0.6 seemed like a good |
| 104 | idea, until I have encoutered Python. Then I become enlightened: we don't |
| 105 | need thousand different iterators (eg. every,search,find, and so on). We |
| 106 | already have one very nice iterator, called for. We can just stick with this |
| 107 | meta-iterator like Python does, and we can have just different iteration macros |
| 108 | for different data types and structers... so this is the way |