Name: Anonymous 2010-03-05 12:46
So how do you write a command line program that asks the user for his name and then says "Hello %name%!" in Lisp?
Program lisphhh;
Begin
WriteLn('the user for his name?');
WriteLn('"Hello %name%!" in Lisp');
End.(format t "Hello ~A!" (read-line))
#include <stdio.h>
int main (void)
{
char name[100];
int x, endl;
printf ("Enter you're name: ");
for (x = 0; (scanf ("%c", &name[x])), name[x] != '\n'; x++);
endl = x;
printf ("Hey there ");
for (x = 0; x < endl; x++)
printf ("%c", name[x]);
printf (", you silly goose!");
return 0;
}
(defun coi ()
(format t "ma cmene do ")
(let ((name (read-line)))
(format t "coi la'o gy. %name% gy.")
name))#include <stdio.h>
int main (void)
{
char name[100];
int x, endl;
printf ("Hey there, sailor, what's your name? ");
for (x = 0; (scanf ("%c", &name[x])), name[x] != '\n'; x++);
endl = x;
printf ("There's no easy way to say this, ");
for (x = 0; x < endl; x++)
printf ("%c", name[x]);
printf (", but the test results came back.\nYou're HIV positive.");
/* Maybe you should stop all of that anus haxxing *
* you goddamned homosexual */
return 0;
}