libera/#lisp - IRC Chatlog
Search
19:49:27
sham1
Just as how I don't want to write an explicit continuation argument for every single lambda I write
19:50:52
jackdaniel
sham1: but some code would be clearer if dynamic variables had their own namespace
19:51:09
jackdaniel
not really an issue because people seem to agree, that such special form is surrounding earmbuffs
19:59:08
sham1
Meanwhile in scheme when one defines a parameter (i.e. a dynamic variable) you get a procedure to call, which gives you the current value
20:06:57
blueyoner
sham1: I now find s-expressions way easier to read than something like C or python
20:08:07
blueyoner
subjectively it feels more like reading a natural language with words and syntactic structures, instead of a list of commands to a machine
20:09:53
sham1
There's a reason why a lot of people go for algol-like syntax and scoff at other stuff
20:10:24
Odin-
Moreover, the difference isn't _really_ in the syntax; you could define an algol-like syntax for a lisp and it would still feel alien to non-lispers.
20:11:12
sham1
Unfamiliar semantics require that the person get over the initial knee-jerk reaction that they get from "why the paren"
20:12:02
sham1
And then came the AI winter. It's interesting that with the renewed interest in doing "AI", lisps haven't taken off. Perhaps people just forgot
20:13:09
jackdaniel
lisp was a suitable general purpose language for "old" ai because methods were about manipulating data (and not crunching numbers)
20:13:44
sham1
There's no reason why something like numpy and tensorflow couldn't have been developed for Common Lisp or whatever
20:33:24
jcowan
I use `list` as a variable/argument name all the time, as long as I don't need the global `list` function in the same lexical scope
20:36:42
jcowan
ISLisp does have a separate namespace for dynamic variables, using DEFDYNAMIC, DYNAMIC, LET-DYNAMIC, and (SETF (DYNAMIC.
23:32:51
kagevf
pjb: "you can define your own namespaces" - did you literally mean "namespace" or were you using it as a synonym for "package"?
23:38:07
moon-child
kagevf: ^ above defines a new namespace for 'blubblers' (whatever those may happen to be)
23:40:21
pillton
moon-child: No. The operations FIND-BUBBLER and ENSURE-BUBBLER define a new namespace.
23:45:00
kagevf
so if I define a dynamic variable, and further define find-<variable name> and ensure-<variable name> I have a namespace??
23:58:55
pjb
kagevf: it doesn't have to be a hash-table. It can be any kind of mapping between a name and an object.
0:02:14
pillton
kagevf: ENSURE-BUBBLER installs a binding between a NAME and an OBJECT. FIND-BUBBLER retrieves the object for a given NAME.
0:05:52
kagevf
pillton: "installs a binding" - would that abstract the interaction with the hash table (or whichever key-value store we use)?
0:08:57
pillton
kagevf: That is right. A namespace is simply a set of name->object pairs. How the set is stored and mutated is irrelevant.
0:21:38
kagevf
I never thought (but by now I should've known) that you could create your own namespaces in CL
0:23:53
kagevf
I don't know scheme much at all, but could something like this be used in scheme to support multiple namespaces? or does it have some fundamental flaw preventing this from working? ... just curious ...
0:25:01
pjb
kagevf: then you can define a macro such as (color-let ((green (0.1 1.0 0.2))) (fill-rect (mix blue green)))
0:27:49
pjb
kagevf: but scheme likes to have a single namespace. So you'd have; (let ((f (lambda (c) (fill-rect (mix blue c)))) (green (color 0.1 1.0 0.2))) (f green))
0:55:40
mdhughes
And in my actual graphics library, I use a combination of symbols, which are keys in an application-specific palette hashtable, ints (decomposed as ARGB), and 4-vectors. SDL takes them as 4 args, so it has to be decomposed sometime.
0:56:53
mdhughes
And if I had a more modern color API, I'd need another way to represent HSL for HDR displays.
1:04:53
White_Flame
if your color names were symbols, then a plist entry on the symbol would be faster than a hashtable lookup
1:07:24
mdhughes
This is in Scheme, and in any case, probably not. A palette is just large enough to make hashtables faster than an alist or tree.
7:44:56
wasamasa
RRRRedEye[m]: this is #lisp, not #javascript, so your chances are abysmally low someone did that for fun