What's the big deal with SICP? Why does /prog/ recommend it for people learning programming? Is it because of the general outlook it gives you on programming (ex: programs aren't just instructions for a computer, but rather methodological paths to implement goals) and therefore gives a better understanding of how programming isn't a task but instead a definition that goes beyond computing? Is it because the language gives you insight into the fact that there are many different ways to get something done, unlike "modern" languages that simplify the API-calling-API-calling-API-calling-API system such that many programmers no longer have any idea of what they're actually doing?
Are there any other books or learning tools that /prog/ would recommend for functional (not functional vs imperative, but functional as in getting-things-done) learning?
Finally, what do the people of /prog/ do with their knowledge in programming with respect to computers and software? Hackers, task-men, etc.?
Finally, what do the people of /prog/ do with their knowledge in programming with respect to computers and software?
We meditate our lives away, contemplating abstract mathematical bullshité.
What's the big deal with lurking more? Why does /b/ recommend it for people learning 4chan? Is it because of the general outlook it gives you on postings (ex: posts aren't just text on a computer, but rather methodological words to implement trolls) and therefore gives a better understanding of how trolling isn't a task but instead a lifestyle that goes beyond computing? Is it because the troll gives you insight into the fact that there are many different ways to take something too seriously, unlike "modern" posters that simplify the meme-spamming-meme-spamming-meme-spamming-meme system such that many trolls no longer have any idea of what they're actually doing?
Are there any other copypasta or learning tools that /b/ would recommend for functional (not functional vs functional, but functional as in functional) learning?
Finally, what do the people of /b/ do with their knowledge in trolling with respect to forums and friends? Trollers, troll-men, etc.?
What's the big deal with SICP? Why does /prog/ recommend it for people learning programming?
If you read it you'll understand. That sounds trite, but it's true. The concepts hard to defend without explaining them fully. So just read it already.
Finally, what do the people of /prog/ do [...]
I write some ARM-targeted software. (With and without an OS.) Aside from that, I work on audio synthesis and mixing software. None of it is OSS. I don't really feel bad about that.
>>7
I've actually already gone through it. I'm asking what the people of /prog/ have derived from it and why they feel it's important. Regardless, I do understand what you mean - I know of many "programmers" who go deer-eyed when they realize that programming isn't meant to just be a hacked together set of plagiarized code.
Interesting work, though. I see no reason to feel bad about doing closed-source work. My only problem with it is when people let a free project atrophy and continue to claim it'll "get better" until people are finally fed up and start doing it on their own (Project64/Mupen64+). Yet, I still feel as though some software should almost always be open source. For me it's drivers. Companies have taken forced obsolescence and proprietization too far, like nVidia disabling CUDA as soon as you install an ATI graphics chip alongside it.
--[t][t]x[/t][/t]
nest _ _ 0 = []
nest t x 1 = "[" ++ t ++ "]" ++ x ++ "[/" ++ t ++ "]"
nest t x n = "[" ++ t ++ "]" ++ (nest t x (n - 1)) ++ "[/" ++ t ++ "]"
Also, I just realised I forgot patterns for empty strings, so that retarded stuff like this []x[/] or this [t][/t] doesn't happen.
--[t][t]x[/t][/t]
nest _ _ 0 = []
nest _ [] _ = []
nest [] _ _ = []
nest t x 1 = "[" ++ t ++ "]" ++ x ++ "[/" ++ t ++ "]"
nest t x n = "[" ++ t ++ "]" ++ (nest t x (n - 1)) ++ "[/" ++ t ++ "]"
Name:
Anonymous2010-05-01 3:40
nest :: String -> String -> Int -> String
nest _ "" _ = ""
nest t s n = open ++ s ++ close
where open = grab ("[" ++ t ++ "]")
close = grab ("[/" ++ t ++ "]")
grab = concat.(take n).repeat
It still should return the original String if you try to nest it in "" tags.
nest :: String -> String -> Int -> String
nest _ "" _ = ""
nest "" s _ = s
nest t s n = open ++ s ++ close
where open = grab ("[" ++ t ++ "]")
close = grab ("[/" ++ t ++ "]")
grab = concat.(take n).repeat
>>45 (x1:x2:x3:x4:x5:x6:x7:x8:x9:x10:x11:x12:x13:x14:x15:x16:x17:x18:x19:x20:y)=
Still looks pretty retarded. Include an input for the number of radians to cycle through, then determine the number of [sup]s and [sub]s to use for each character by the value of tan for its index. Optimise output size later.
data BBCodeStyle = B | I | O | U | S | M | AA | Sup | Sub | Spoiler | Code
deriving (Eq, Show)
data BBCodeText = Style [BBCodeStyle] BBCodeText | Text String
| Sep BBCodeText [BBCodeText]
deriving Show
render = putStrLn . go -- . optimize
where go (Text s) = s
go (Sep s bs) = go s `intercalate` map go bs
go (Style ts bt) = makeTag ts $ go bt
makeTag [] = id
makeTag (x:xs) = surround (nameOf x) . makeTag xs
nameOf = map toLower . show
surround name text = concat ["[", name, "]", text, "[/", name, "]"]
-- This is useless right now but I want to use it to remove adjacent
-- closing/opening bbcode tags, which is the whole reason I did this all as
-- combinators instead of just passing strings around
optimize = go
where go (Style [] t) = optimize t
go (Sep (Text "") xs) = undefined -- let ys = groupBy sameStyle xs
-- Breaks [sub][sub] etc. :(
-- go (Style (x:xs@(y:ys)) t) | x == y = optimize (Style xs t)
go anything = anything
sameStyle (Style (x:_) _) (Style (y:_) _) = x == y
sameStyle _ _ = False
buttsort fs = bbConcat . go (cycle fs)
where go fs (' ':xs) = Text " " : go fs xs
go (f:fs) (x:xs) = f [x] : go fs xs
go _ [] = []
expert = style [B, I, O, U]
loveyourpost = bbUnwords $ zipWith style1 [B, I, O, U] $
lines "I LOVE YOU!\nI LOVE YOUR POST!\nI READ IT FIVE TIMES!\nKEEP POSTING!"
fibsButtSort = buttsort [style1 U, style1 O]
>>52 -- This is useless right now but I want to use it to remove adjacent
-- closing/opening bbcode tags, which is the whole reason I did this all as
-- combinators instead of just passing strings around
Can't you just use a regex
Name:
Anonymous2010-05-01 15:59
This, people, is why SICP is important. It makes people turn retarded code into less retarded code by proving there's more than one fucking way to do something, and there's going to be a best way in every case.
Name:
512010-05-01 16:34
>>52 BBCODE isn't case sensitive; you don't need to map toLower
Also, shouldn't sameStyle be recursive? Something like sameStyle (Style s1 _) (Style s2 _) = and . zipWith (==) s1 s2?
Other than that, thank you. You have restored my faith in /prog/ after the most horrific mangling of Haskell I have ever seen.
Name:
Anonymous2010-05-01 16:42
>>52 # aa b code i m o s spoiler sub sup u
You are missing the octothorpe tag.
>>53 Can't you just use a regex
A regex alone is not enough medicine. This is more of a parser problem, and I don't want to parse the BBCode. I already generated it programmatically.
>>55 Also, shouldn't sameStyle be recursive? Something like sameStyle (Style s1 _) (Style s2 _) = and . zipWith (==) s1 s2?
It's a bit of a misnomer. It's only for checking the outermost style, so I can rewrite [b]foo[/b][b]bar[/b] as [b]foobar[/b]. Refer to the comments.
Other than that, thank you. You have restored my faith in /prog/ after the most horrific mangling of Haskell I have ever seen.
I dunno. I think /prog/ needs a lot more work than just that.
>>56
I didn't have any test functions that generate it. Write me one and I'll buckle down and manually write a Show instance or something.