Help [scheme]
1
Name:
Anonymous
2008-01-27 7:29
(define (read-file port)
(lambda (line)
(if line
(begin
(display line)
(read-file port))))
(read-line port))
(call-with-input-file 'file read-file) ; doesnt work
y doesnt work ;_;
2
Name:
Anonymous
2008-01-27 7:49
ONE WORD:
THE LACK OF PROPER INDENTATION OF CODE
THREAD OVER
3
Name:
Anonymous
2008-01-27 8:07
that lambda right there fails hard
4
Name:
Anonymous
2008-01-27 8:14
>>3
Either the lambda or the
syntatic sugar that anti-cudder Abelson likes.
Do the pure (define read-file (labda (port) ...)
5
Name:
Anonymous
2008-01-27 8:19
OP here whoa you faggots are either trolling or you are fucking clueless.
>>3
I prefer it instead of let
>>4
Irrelevant.
6
Name:
Anonymous
2008-01-27 8:53
>>5
I prefer it instead of let
Hard troller trolls hard.
7
Name:
Anonymous
2008-01-27 8:56
8
Name:
Anonymous
2008-01-27 9:17
Somehow i get this feeling that you faggots posting ``read SICP'' are Java faggots in their uni.
9
Name:
Anonymous
2008-01-27 9:24
call/cc and other continuation operators considered harmful.
10
Name:
Anonymous
2008-01-27 10:19
Use proper quotes.
11
Name:
Anonymous
2008-01-27 10:19
12
Name:
Anonymous
2008-01-27 10:20
Just.. read... SICP, fucks sake
13
Name:
Java faggots in their uni
2008-01-27 10:29
``read SICP''
14
Name:
Anonymous
2008-01-28 8:20
bump faggots
15
Name:
Anonymous
2008-01-28 8:28
(apply sicp your-code)
16
Name:
Anonymous
2008-01-28 8:33
“read SICP”
17
Name:
Anonymous
2008-01-28 12:51
so, why?
18
Name:
Anonymous
2008-01-28 13:11
>>17
If you don't know why, clearly you've got to read SICP
19
Name:
Anonymous
2008-01-28 13:13
i cant believe im asking a fucking scheme question here and i get no replies
20
Name:
Anonymous
2008-01-28 13:16
>>19 Idiot!
You question was already answered.
IHBT, I know
21
Name:
Anonymous
2008-01-28 13:19
>>20
''read SICP'' no shit.
god dammit you faggots i wish you didn't fucking scream YHBT IHBT all the godamn fucking time.
/prog/ was good, until retards came here thinking they are real trolls.
22
Name:
Anonymous
2008-01-28 13:27
>>21
So, are you a real troll?
23
Name:
Anonymous
2008-01-28 13:30
>>22
Nah, he's just an idiot. Real trolls use proper spelling and `proper quotes'.
24
Name:
Anonymous
2008-01-28 13:41
bump
25
Name:
Anonymous
2008-01-29 6:18
bump.
26
Name:
Anonymous
2008-01-29 6:58
bump answer fucgk you
27
Name:
Anonymous
2008-01-29 10:04
bump
28
Name:
Anonymous
2008-01-29 11:44
2008-01-29 10:04
bump
29
Name:
Anonymous
2008-01-29 11:52
30
Name:
Anonymous
2008-01-29 12:45
28 Name: Anonymous : 2008-01-29 11:44
2008-01-29 10:04
bump
29 Name: Anonymous :
31
Name:
Anonymous
2008-01-29 12:54
bump
32
Name:
Anonymous
2008-01-29 14:01
(define (read-file port)
((lambda (line)
(if (not (eof-object? line))
(begin
(display line)
(newline)
(read-file port))))
(read-line port)))
(call-with-input-file "/etc/hosts" read-file)
##
# Host Database
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
There, fixed your shitty code. Could be better, but I wanted to be as close to you FAIL code as possible.
33
Name:
Anonymous
2008-01-29 14:01
Also: bump
34
Name:
Anonymous
2008-01-29 14:05
>>32
Ah, fuck.
read-line doesn't evaluate to nil on EOF eh.. fuck.
thanks, what would be a better way to read a file line by line?
(for further line processing)
Anyway, I won't bump this again since someone FUCKING ANSWERED. WOO WOO.
35
Name:
Anonymous
2008-01-29 14:13
NIGGER PENUS OM NOM NOM NOM
8==========================D
36
Name:
Anonymous
2008-01-29 14:51
HAX?
37
Name:
Anonymous
2010-11-15 0:29