The same sort of syntax was used in HyperTalk (with "into"): https://en.wikipedia.org/wiki/HyperTalk#Description I wouldn't be surprised to hear of it in AppleScript, either, although I can't recall.
For my own language design I've wanted to introduce some of this ABC syntax back into Python. Mainly for unpacking data and doing index/slice assignments; a lot of beginners seem to get tripped up because assignments in Python use the same syntax as mutations, so maybe it's better to write e.g. `a['b'] = c` like `set b = c in a`, or `update a with {'b': c}`, or ... who knows, exactly.
Especially when you are dealing with nested functions. You'd get around the whole need for 'global' and 'nonlocal' declarations. (Though your linter might still ask you for them for clarity.)
As a minimal syntax change, I would propose using perhaps = for introduction of a variable (the common case) and := for an explicit mutation of an existing variable.
But you could also use `let . = ..` and `. = ..` like Rust does.
Python only got its own GIL in version 1.5 of CPython.
HOW TO RETURN words document:
PUT {} IN collection
FOR line IN document:
FOR word IN split line:
IF word not.in collection:
INSERT word IN collection
RETURN collection
In Python it would be: def words(document):
collection = set()
for line in document:
for word in line.split():
if word not in collection:
collection.add(word)
return collection
I kept the splitting by line and "if word not in collection:" in there even though they don't have an impact on the outcome. I have the feeling that even in the original example they have only been put there to show the language constructs, not to do anything useful. If one wanted to optimize it, it could all be collapsed to just "return set(text.split())", but that would not show off the language features.ABC uses 225 chars, Python 218 chars. 3% less.
So one could say Python is 3% more efficient than ABC.
public static function words(string $document): array {
which some languages these days are coming up with.I think def is good though. I guess with new fangled prompt engineering you could use the english version.
>, though is verbose, at least means something
I disagree, it is hardly verbose. there can be further detailing of the input and return value of the function beyond a simple type. Java didn't go far enough, not by a long shot - we need hardcore painstaking, completely brutal typing. Such typing will be highly beneficial for software reliability - you're not against reliability are you?
DISCOVER HOW TO words WITH document
DISCOVER THE SHOCKING TRUTH ABOUT HOW TO hello WITH name:
PRINT "hello " + name DISCOVER THE SHOCKING TRUTH ABOUT HOW TO hello WITH name:
YOU WON'T WANT TO MISS "hello " + nameHERE ARE THE TOP 10 fibbonacci_numbers:
YOU WON'T BELIEVE n := 6
Did early linux have this? Maybe netbsd?
I actually found it. It was on simtel: https://archive.org/details/Simtel20_Sept92
I must have gotten it from there. I would routinely get any thing Walnut Creek would make.
I also realized a couple years ago I could navigate EDLIN without help and knew how to use masm. Somehow I had forgotten what I know but my fingers did not.
https://en.wikipedia.org/wiki/Simtel
It was called SIMTEL20 for a while because it was hosted on a PDP-10 mainframe running the TOPS-20 operating system, but apparently it was hosted on a PDP-10 running ITS first:
> The archive was hosted initially on the MIT-MC PDP-10 running the Incompatible Timesharing System,[1] then TOPS-20, then FreeBSD servers
Maybe I am remembering this wrong...
dvdkon•2mo ago
nuancebydefault•2mo ago
nick__m•2mo ago
I think you meant 2**1000
the syntax for formatting ate your star https://news.ycombinator.com/formatdoc
nuancebydefault•2mo ago
swores•2mo ago
pansa2•2mo ago
The reason for using `**` is that `^` is widely used for bitwise exclusive-or. So commonly `2**1000 != 2^1000`!
kragen•2mo ago
shawn_w•2mo ago
vanderZwan•2mo ago
kragen•2mo ago
I should have said "followed Fortran rather than BASIC".
shawn_w•2mo ago
https://en.cppreference.com/w/c/numeric/math/pow.html
kragen•2mo ago
vincent-manis•2mo ago
kragen•2mo ago
But IBM's BCD character sets, including the 48-character ones you allude to, didn't: https://en.wikipedia.org/wiki/BCD_(character_encoding)#Examp... (though Honeywell's did)
There are a lot of decisions in Fortran that stem from the absence of useful characters. .LT., .LE., .EQ., .NE., .GT., and .GE. is another.
swores•2mo ago
fainpul•2mo ago
Lucasoato•2mo ago
jockm•2mo ago
doug-moen•2mo ago
aidenn0•2mo ago
mpweiher•2mo ago
LISP had it, Smalltalk had it, Unix dc/bc had it.