fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

9.8K
active users

#stdin

0 posts0 participants0 posts today

Wrote this #lisp hello world #gui #cloud app last few minutes, just smart enough to draw and exit on right click. Just uses #stdin #stdout output same as the #bash and #C implementations (setq x "Fo 0 999 3\nF 0 255\nL$ 0 0 800\"Hello world\"\nZ \n")
(while (setq p (asc (fgets stdin))) (cond ((== p 100) (write 1 x (strlen x))) ((== p 51) (exit 0)))) This code is out on bitbucket timcdoc antibrowser lisp hello (sub C or bash for lisp to see others)

Continued thread

`input` in read from . It's pretty straight forward.

But this is how *most* tools work in Linux. Often times you can give them data on stdin instead of in a file. In Python you might do it like

import sys

if len(sys.argv) > 1:
with open(sys.argv[0]) as f:
data = f.read()
else:
data = sys.stdin.read()

You've gotta .read() from stdin, since `input` just looks for the first newline. Anyway. Piping is a very fundamental part of Linux command line.

Continued thread

Now remember - so far all of this is just to get two lists - my TableOfContents and all of the WikiWords that exist in my file.

If you use or for any period of time (or - where my pedants at?), you will probably have come across `sort`.

Now we get to talk about streams and files!

Everything in Linux is a file. Which is shockingly powerful. Input from the keyboard? A file you can read from. Output to the screen? A file you can write to. and are their names

Continued thread

Wildes #Ausprobieren.

#Was ist #eingeschlossen?
#Was ist #ausgeschlossen?

#stdin #stdout #stderr
#Input / #Output / #Error (Output)

Ein #Fall, in dem ich (noch) nicht #imstande bin, #Anweisung​en einzusehen, ich also nur durch #ausprobieren #herausfinden kann, was ein- und was #ausgeschlossen ist. Keine #Möglichkeit also, (un)vollständigkeit festzustellen

#Einsehen; #Vollständigkeit; #Unvollständigkeit; #Feststellung