Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
|
|
@ -2,6 +2,6 @@
|
|||
I :argv.len == 1
|
||||
print(File(‘notes.txt’).read(), end' ‘’)
|
||||
E
|
||||
V f = File(‘notes.txt’, ‘a’)
|
||||
V f = File(‘notes.txt’, APPEND)
|
||||
f.write(Time().format("YYYY-MM-DD hh:mm:ss\n"))
|
||||
f.write("\t"(:argv[1..].join(‘ ’))"\n")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
$ENTRY Go {
|
||||
, <ArgList>: {
|
||||
= <PrintNotes>;
|
||||
e.Args = <WriteNote e.Args>;
|
||||
};
|
||||
};
|
||||
|
||||
ArgList {
|
||||
= <ArgList 1>;
|
||||
s.N, <Arg s.N>: {
|
||||
= ;
|
||||
e.Arg = (e.Arg) <ArgList <+ s.N 1>>;
|
||||
};
|
||||
};
|
||||
|
||||
PrintNotes {
|
||||
, <ExistFile 'notes.txt'>: {
|
||||
False = ;
|
||||
True = <PrintFile 1 'notes.txt'>;
|
||||
};
|
||||
};
|
||||
|
||||
PrintFile {
|
||||
s.Chan e.File = <Open 'r' s.Chan e.File> <PrintFile (s.Chan)>;
|
||||
(s.Chan), <Get s.Chan>: {
|
||||
0 = <Close s.Chan>;
|
||||
e.Line = <Prout e.Line> <PrintFile (s.Chan)>;
|
||||
};
|
||||
};
|
||||
|
||||
WriteNote {
|
||||
e.Args, <Time> '\n\t' <Join (' ') e.Args> '\n': e.Note =
|
||||
<Open 'a' 2 'notes.txt'>
|
||||
<Put 2 e.Note>
|
||||
<Close 2>;
|
||||
};
|
||||
|
||||
Join {
|
||||
(e.X) = ;
|
||||
(e.X) (e.1) = e.1;
|
||||
(e.X) (e.1) e.2 = e.1 e.X <Join (e.X) e.2>;
|
||||
};
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
program notes;
|
||||
if #command_line = 0 then
|
||||
show_notes;
|
||||
else
|
||||
write_note;
|
||||
end if;
|
||||
|
||||
show_notes::
|
||||
if (notefile := open('notes.txt', 'r')) = om then
|
||||
stop;
|
||||
end if;
|
||||
|
||||
loop for line in [getline notefile : until eof(notefile)] do
|
||||
print(line);
|
||||
end loop;
|
||||
|
||||
close(notefile);
|
||||
|
||||
write_note::
|
||||
notefile := open('notes.txt', 'a');
|
||||
note := (+/[' ' + a : a in command_line])(2..);
|
||||
puta(notefile, date + '\n\t' + note + '\n');
|
||||
close(notefile);
|
||||
end program;
|
||||
Loading…
Add table
Add a link
Reference in a new issue