I'm tinkering my stack-based reverse polish notation calculator written in Scheme. It has a nice interface for hard-coding in new functions quickly, but I can't find a good way to store session-specific functions. I have a built in variable assignment system though.
I heard that Bjarne Stroustrup summon the devil to make the first C++ parser
Is that true?
Name:
Anonymous2013-10-03 0:30
>>12
That's exactly what I do, actually. I just pick the numbers on the stack and run the command on them, then put the result of that function call onto the stack.
Of course, it assumes you use numbers so things like string manipulation aren't possible (to be fair, putting something like that in a calculator would be bloat).
For example, this is a big list of functions that I put in the code.
(define functions
(list
(list "pi" 3.14159265359 0)
(list "e" 2.71828182845 0)
(list "id" identity 1)
(list "add1" add1 1)
(list "sub1" sub1 1)
(list "abs" abs 1)
(list "cos" cos 1)
(list "sin" sin 1)
(list "tan" tan 1)
(list "nl" log 1)
(list "phi" phi 1)
(list "sqrt" sqrt 1)
(list "round" int-round 1)
(list "+" + 2)
(list "*" * 2)
(list "/" / 2)
(list "-" - 2)
(list "**" expt 2)
(list "ack" ack 2)
(list "mod" modulo 2)
(list "gcd" gcd 2)
(list "log" log-b 2)))
The first member of every list is the string which is matched to the command run by the user. The second item of the list is either a value or a symbol which is assigned to a function (incidentally, you can use lambda expressions here, so add1 could be (lambda (x) (+ 1 x)) instead).
Adding a member to the list is the same as adding a new function, so if I wanted an add3 command, I could just add
(list "add3" (lambda (x) (+ 3 x) 1)
to the list and it'll work.
The third argument is the number of arguments needed for the function. So you can't do:
10 10 10 +
and expect to get thirty. A "function" with 0 arguments just puts the number onto the stack (useful for things like pi or e).
>>30
You haven't seen real autism until you go to /jp/. Most of /g/ is pretty tame, except for the DPTs, which have become a hotspot for shitposting and language fanaticism.
Name:
Anonymous2013-10-03 10:48
>>34
I can say that the most people at /DPT/ are autists!
>>29
you know, that thread you responded to probably rubbed someone's autism the wrong way and they used your GET to derail it
dubs/quads/etc have become a destructive weapon against shitty threads on the imageboards
Name:
Anonymous2013-10-03 10:56
against shitty threads
Do you mean against threads whitch people don't like?
Name:
Anonymous2013-10-03 11:06
>>38
Not always. You see that more on /v/. Last I was there I saw someone doing it to a "gamer food" thread.
Name:
Anonymous2013-10-03 11:13
Report and hide this thread, it uses a forced image, the original is the Yuki image.
The reason why we use the Yuki image is because she has relevance to programming, while Asuka, Hatsune Miku, and most other forced images do not.
Also because of tradition, Yuki has been the face of daily programming threads for years, people who try to force a different image are just trolls trying to incite image wars, they should be reported.
If a Yuki thread hasn't been made already, make a new one.
We need consistency, report and hide non-Yuki DPT threads.
I can't seem to get this to work. Any ideas on how to fix it?
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnUserInput.Click
Dim strUserInput
Dim IntUserInput As Integer
Dim i As Integer
strUserInput = InputBox("Enter a positive integer value", "Input Needed", 10)
If strUserInput <> String.Empty Then
Try
IntUserInput = CInt(strUserInput)
If IntUserInput < 0 Then
MessageBox.Show("Negative numbers are not accepted.")
Exit Sub
End If
MessageBox.Show("Sum of Numbers", "The sum of numbers" & (i + IntUserInput), MessageBoxButtons.OK)
Catch ex As Exception
MessageBox.Show("Quantity amount must be numeric.")
End Try
Else
MessageBox.Show("Error, input valid number", "You must enter a positive integer value", MessageBoxButtons.OK)
Exit Sub
End If
>>61
Sorry, and when it executes, I enter a number in which is supposed to make a message box pop up giving me the sum of all integers from 1 to that input number.
>>78
no, it goes till 1000 posts
Welcome to /pro/g//:D:D:D:D:DDD:D
Name:
Anonymous2013-10-04 15:04
>le pedophile bump
Name:
Anonymous2013-10-04 20:38
I'm working on my own string library for Scheme. It's deliberately rather bloated, so I don't know if I'll ever use it as an actual library or just a place for copypasting code.
░░░░░░░▄▀▀▀▀▀▀▀▀▀▀▄▄░░░░░░░░░
░░░░▄▀▀░░░░░░░░░░░░░▀▄░░░░░░░
░░▄▀░░░░░░░░░░░░░░░░░░▀▄░░░░░ YOU HAVE BEEN VISITED BY
░░█░░░░░░░░░░░░░░░░░░░░░▀▄░░░ LE 'FEEL OF NO GF
░▐▌░░░░░░░░▄▄▄▄▄▄▄░░░░░░░▐▌░░
░█░░░░░░░░░░░▄▄▄▄░░▀▀▀▀▀░░█░░ A qt 3.14 gf will come to you,
▐▌░░░░░░░▀▀▀▀░░░░░▀▀▀▀▀░░░▐▌░ but ONLY if you post a
█░░░░░░░░░▄▄▀▀▀▀▀░░░░▀▀▀▀▄░█░ `>tfw no GF on this thread
█░░░░░░░░░░░░░░░░▀░░░▐░░░░░▐▌
▐▌░░░░░░░░░▐██▀█▄░░░░░░█▀█░▐▌
░█░░░░░░░░░░░▀▀▀░░░░░░▀▀▀▀░▀▄
░▐▌░░░░▄░░░░░░░░░░░░░▌░░░░░░█
░░▐▌░░▐░░░░░░░░░░░░░░▀▄░░░░░█
░░░█░░░▌░░░░░░░░▐▀░░░░▄▀░░░▐▌
░░░▐▌░░▀▄░░░░░░░░▀░▀░▀▀░░░▄▀░
░░░▐▌░░▐▀▄░░░░░░░░░░░░░░░░█░░
░░░▐▌░░░▌░▀▄░░░░▀▀▀▀▀▀░░░█░░░
░░░█░░░▀░░░░▀▄░░░░░░░░░░▄▀░░░
░░▐▌░░░░░░░░░░▀▄░░░░░░▄▀░░░░░
░▄▀░░░▄▀░░░░░░░░▀▀▀▀█▀░░░░░░░