Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
main(argc, argv) | |
int argc; | |
char *argv[]; | |
{ | |
int i; | |
argc--; | |
for(i=1; i<=argc; i++) | |
printf("%s%c", argv[i], i==argc? '\n': ' '); | |
} |
My efforts to port http://www.youtube.com/watch?v=f6kdp27TYZs to Clojure.
func boring(msg string) {
for i := 0; ; i++ {
fmt.Println(msg, i)
time.Sleep(time.Second)
}
Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki
(defn double-map [f] | |
(let [^clojure.lang.IFn$DD f f] | |
(fn [f1] | |
(if (instance? clojure.lang.IFn$DDD f1) | |
(let [^clojure.lang.IFn$DDD f1 f1] | |
(fn | |
([] (f1)) | |
(^double [^double result] (.invokePrim ^clojure.lang.IFn$DD f1 result)) | |
(^double [^double result ^double input] | |
(.invokePrim f1 result (.invokePrim f input))) |
#!/bin/bash | |
# --------------------------------------------------------------------------- | |
# OO support functions | |
# Kludged by Pim van Riezen <pi@madscience.nl> | |
# --------------------------------------------------------------------------- | |
DEFCLASS="" | |
CLASS="" | |
THIS=0 |
Links for essays ref'd in http://blog.fogus.me/2009/03/11/seven-books/
#!/usr/bin/env bash | |
#_" -*- mode: clojure; -*-" | |
#_( | |
"exec" "clojure" "-Sdeps" "{:deps {clj-kondo/clj-kondo {:mvn/version \"2020.12.12\"} org.clojure/tools.deps.alpha {:mvn/version \"0.9.857\"} org.slf4j/slf4j-nop {:mvn/version \"1.7.30\"} lambdaisland/deep-diff2 {:mvn/version \"2.0.108\"} juji/editscript {:mvn/version \"0.5.4\"}}}" "-M" "$0" "$@" | |
) | |
;; Example usage: | |
;; api_diff.clj org.clojure/clojure "1.8.0" "1.10.1" > /tmp/diff.txt | |
(require '[clj-kondo.core :as clj-kondo]) |
Jim Weirich:
This is how I explain it… Ruby has Procs and Lambdas. Procs are created with
Proc.new { }
, lambdas are created withlambda {}
and->() {}
.
In Ruby 1.8,
proc {}
creates lambda, and Ruby 1.9 it creates procs (don't ask).
Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.
This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.
; http://groups.google.com/group/clojure/browse_thread/thread/974e2c7f89e27231/5f4bff3e58dfa36f | |
; output images http://i.imgur.com/gSASS.png (square maze) | |
; http://i.imgur.com/uEqaq.png (hex maze) | |
;; generic Wilson's algorithm implementation | |
(defn maze | |
"Returns a random maze carved out of walls; walls is a set of | |
2-item sets #{a b} where a and b are locations. | |
The returned maze is a set of the remaining walls." | |
[walls] |