$ time npm sart
Unknown command: "sart"
Did you mean this?
npm start # Start a package
To see a list of supported npm commands, run:
npm help
real 0m3.998s
user 0m0.216s
sys 0m0.369s
ginger@gingerdrop:~/Rabbit$ time pip --version
pip 23.0.1 from /home/ginger/.local/lib/python3.10/site-packages/pip (python 3.10)
real 0m0.976s
user 0m0.622s
sys 0m0.091s
@RydwolfPrograms so, exactly what types should go into the error parameter of a Result? I've asked you this question before but I haven't really understood your answers
And if, later, that function starts returning a new type of error, your code can't be compiled/start to be interpreted then panic later on when it receives an error it didn't know was possible
Because the "something that is" is important, since it could either be "anything that is, determined at runtime" or "something that is, which is known definitively"
I guess that is precendent for doing that, but I still think it would create unnecessary confusion just to save four keystrokes, and it would encourage doing something that should be a last resort out of laziness
E.g., why would I bother using the much longer generic syntax if I can just be lazy and use a dynamically dispatched Dog
This is the robbers' challenge. To post a cop, go here.
In this challenge, cops will invent a (likely simple) programming language, and write an interpreter, transpiler, or compiler that allows you to run it. Robbers will write a program in this language that manages to inject arbitrary code into...
This is the cops' challenge. To post a robber, go here.
In this challenge, cops will invent a (likely simple) programming language, and write an interpreter, transpiler, or compiler that allows you to run it. Robbers will write a program in this language that manages to inject arbitrary code into...
tinylisp is, in its essence, a very stripped-down version of Lisp, as the name suggests. It was made by @DLosc for an "interpret this language" challenge, which can be found here. It features a small amount of builtins, which can be used to create practically anything.
There is a repository for ...
@user temp ~ List<string> = "Hello, World!" -> to Characters turns the string to a list of characters and stores it in temp, temp -> makeString does well what you would expect it to do, println ^ prints the result of the line above and println ^^^ -> makeString prints the result of calling makeString on the result of the line 3 lines above
@Seggan Just saw this. Swift has two ways of error-handling: throw and Result. Result is typed better but throw has more syntax conveniences. Give me a moment to explain
func foo() throws {
// throws is untyped.
// It can throw anything that adopts the Error protocol.
throw MyCustomError()
}
func bar() throws {
// To rethrow an error, use try with no catch:
try foo()
}
func die() {
// If you're confident that an error will never be thrown, you can use the
// try! operator. If an error *is* thrown, the program crashes.
try! foo()
}
func handleErr() {
// If you want to explicitly handle the error, the syntax is a bit weird:
do {
try foo()
In some cases you can omit the keyword any in Swift 5 (but this won't be allowed in Swift 6)
@Seggan I would rather write View<some View> than View<_ConditionalContent<Button<Text>, VStack<TupleView<(Text, Button<ZStack<TupleView<(Rectangle, Text)>>>, TextField)>>>>
That's not even an unreasonable example, I've had some abstract over types well over 300 characters long
The some Viewhere is short for VStack<TupleView<(ModifiedContent<Button<Text>, { some internal type }>, Divider, _ConditionalContent<AnyView, List<Int, ForEach<[Int], Int, Text>>>, ModifiedContent<Button<Text>, { some internal type }>)>>. And that's way simpler than a real-world use case would be
I write { some internal type } because I don't know what type the .padding modifier actually uses
Anyways I have to go back to writing my paper (due in like four hours)