What to learn? Lisp or OCaml or…? [closed]

Neither Lisp nor OCaml is super far afield from what you already know. Here are four suggestions chosen partly for intrinsic interest and partly to stretch your horizons. A logic programming language, probably Prolog. I haven’t found good materials online, but the book The Art of Prolog by Sterling and Shapiro is excellent. The more … Read more

values function in Common Lisp

Multiple Values in CL The language Common lisp is described in the ANSI standard INCITS 226-1994 (R2004) and has many implementations. Each can implement multiple values as it sees fit, and they are allowed, of course, to cons up a list for them (in fact, the Emacs Lisp compatibility layer for CL does just that … Read more

Separate Namespaces for Functions and Variables in Common Lisp versus Scheme

The two different approaches have names: Lisp-1 and Lisp-2. A Lisp-1 has a single namespace for both variables and functions (as in Scheme) while a Lisp-2 has separate namespaces for variables and functions (as in Common Lisp). I mention this because you may not be aware of the terminology since you didn’t refer to it … Read more

Why do we need funcall in Lisp?

Strictly speaking, funcall would not be needed, but there are some lisps (lisp-2 variants, such as Common Lisp) that separate the variable name space of the function name space. Lisp-1 variants (e.g. Scheme) do not make this distinction. More specifically, in your case, test-func is in the variable name space. (defun foo (test-func args) (funcall … Read more

Functional Programming in C# vs LISP [closed]

Doing functional programming in C# is technically possible (well, any language that has function pointers or delegates equivalent can be “functional”) — but C# gets very very painful if you try to do much. Off the top of my head, in no particular order: Type inference Only exists for locals now Should apply to pretty … Read more

How do multimethods solve the namespace issue?

Dynamic dispatch and namespace resolution are two different things. In many object systems classes are also used for namespaces. Also note that often both the class and the namespace are tied to a file. So these object systems conflate at least three things: class definitions with their slots and methods the namespace for identifiers the … Read more

What does the f in setf stand for?

The actual meaning of F is often forgotten. According to some sources, f suffix could stand for: Field (see for example this answer) Form (as seen in various teaching materials and manuals) However, according to Gabriel and Steele’s The Evolution of Lisp, SETF comes from Peter Deutsch’s A Lisp Machine with Very Compact Programs (published … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)