Earlier quoted context omitted.
I wonder what a web browser would look like if it evolved inside emacs.
There were and still are approaches to web browsing in Emacs. But like every other completely mainstream web browser, keeping up with the evolving web, and especially its client-side programmability and performance needs, made its usefulness rather marginal. In the end it’s often less trouble to switch over to the browser window that’s already open anyway and copy and paste data between it and emacs.
The Emacs Calculator (2009)
51–57 of 57 posts
Re: The Emacs Calculator (2009)
#52Earlier quoted context omitted.
I wonder what a web browser would look like if it evolved inside emacs.
There were and still are approaches to web browsing in Emacs. But like every other completely mainstream web browser, keeping up with the evolving web, and especially its client-side programmability and performance needs, made its usefulness rather marginal. In the end it’s often less trouble to switch over to the browser window that’s already open anyway and copy and paste data between it and emacs.
Re: The Emacs Calculator (2009)
#53I love Emacs but the calculator, being stack based is just too awkward for me. I know there is the "algebraic mode" but it still is too much. Is there a way to configure it to work like, say, SpeedCrunch (my favorite calculator by far) ?
Gotta raise my hand here too. I'm in my mid-40's, have worked at all levels of the software stack, have played with favored development tools of like nine generations of engineers. I still can't wrap my brain around a RPN calculator well enough to use it productively (but boy howdy can I tell you how the stack engine works!). All the cool kids in physics class in the 80's were using HP's, and I felt left out even the…
Normal (non-algebraic) calculators are inconsistent. To get "2+3", it's infix: 2, +, 3, =. To get "cos(45)" it's postfix: 45 cos (and no equals). And something like "cos(2+3)" is a mixture of both. RPN, is always the same, numbers first, then operators, and usually more keystroke efficient. Some operators take multiple arguments.
RPN also has the advantage of (rarely) needing a memory register, since the values can be left on the stack and accessed as they are needed.
Re: The Emacs Calculator (2009)
#54Earlier quoted context omitted.
I would really like a postfix lisp. I wonder what edge cases I would run into designing one.
Aren't concatenative languages like Forth and Factor essentially what you're looking for?
I was wondering how difficult it would be to make a common lisp or scheme, but with postfix syntax instead of prefix.
Re: The Emacs Calculator (2009)
#55Earlier quoted context omitted.
Aren't concatenative languages like Forth and Factor essentially what you're looking for?
They are very focused on the stack, which isn't very lispy. I was wondering how difficult it would be to make a common lisp or scheme, but with postfix syntax instead of prefix.
[10]> (defmacro rev (&rest forms)
`(progn ,@(mapcar (lambda (form)
(if (and (consp form) (rest form))
`(,(car (last form)) ,@(butlast form))
form))
forms)))
REV
[11]> (rev (1 1 +))
2
[12]> (rev (3 print) (1 1 +))
3
2Re: The Emacs Calculator (2009)
#56Earlier quoted context omitted.
And yet so many RPN people are Lisp programmers the rest of the time. I guess it balances out.
I would really like a postfix lisp. I wonder what edge cases I would run into designing one.
A Lisp macro (rpn ...) could provide a DSL whereby all the forms in ... are recursively code walked and turned from a postfix notation into a regular Lisp notation.
You probably want the walker not to fiddle with expressions like '(a b c) quoted lists. That creates a special case to handle. You have to know that (quote (a b c)) is in a context where it is evaluated (which normally undergoes rpn to Lisp transformation) and so should be left alone. You don't want (quote z) being treated as RPN denoting (z quote)! Likewise, you don't want #'foo, which is (function foo) to be turned into (foo function).
So, basically, a code walker is needed which knows what is evaluated and what isn't, which leaves alone stuff that isn't evaluated, and also avoids RPN-to-lisp-transforming certain expressions that are evaluated.
Re: The Emacs Calculator (2009)
#57Earlier quoted context omitted.
How does it compare with good old command line 'mc'?
you mean "bc" ? Dunno, never used a lot. For computations such as 10+3, it's comparabale. But I give SpeedCrunch an dedge because it can compute "sin(pi/2)" out of the box.