<beneroth>
aw-, I like the explaining part, but hate the "argh why does this not render nicely"-part. and now I'm stressed because I underestimated the required time, and I have a fixed deadline.
<Regenaxer>
Perhaps some compiler build them at compile time to unlimited length
<beneroth>
prolly not, that would be to simple and practical, no? :P
<Regenaxer>
Even the blind chicken finds a corn ;)
<Regenaxer>
aw-, another option would be 'nth'
<Regenaxer>
(nth Lst 2 -1)
<beneroth>
but yeah, this combinations are the reason why this (unfamiliar) car/cdr terms stayed with lisp, (second (first (second List))) and (secondfirstsecond List) is just uglier
<Regenaxer>
yeah, some "clever" Lisps went away from car and cdr
<beneroth>
I think Common Lisp has first and second... but car/cdr, too
<beneroth>
not sure
<Regenaxer>
yes, could be
<Regenaxer>
car/cdr it has for sure
<beneroth>
it was heavily discussed in the beginning of Arc (pg's Lisp), but then kept just because it's practical, so new people just have to get used to it
<Regenaxer>
good
<aw->
hmmm
<beneroth>
afaik Arc is mostly dead, no? It promised a lot and was never fully finished afaik. And most of what it promised picolisp delivers for a much longer time already.
<aw->
so other languages don't have anything even close to (cddadr) ?
<aw->
beneroth: oh right right, yeah i knew about those actually
<beneroth>
list and mapping operations are leaking into mainstream languages. natural result of the 60 year long trend of taking stuff from lisp without reall ybecoming lisp.
<beneroth>
tankf33der, thanks!
<beneroth>
racket is considered a lisp dialect afaik, no?
<Regenaxer>
A Scheme
<aw->
scheme
<Regenaxer>
So in many ways similar to Lisp
<beneroth>
and scheme is a major branch within the lisp family. or is this kinda wrong statement?
<aw->
oh yeah, Racket seems to have up to 4 as well
<Regenaxer>
I tend to say that it is not a real Lisp
<Regenaxer>
But thats a matter of definition
<beneroth>
the LINQ in C# is a bit similar to lisp (lambda/anonymous functions, and a kind of map functions). Implemented kinda like C++ free operators / global methods/functions. It's used either to process lists or generate SQL queries during runtime.
<beneroth>
heavy breach with the "normal" C# syntax, and depending on if you operate on lists in memory, or actually on DB stuff (SQL), it behaves a bit differently and not everything is allowed in both contexts
<beneroth>
highly confusing.
<beneroth>
new thing in C# from recent years.. now C# is kinda a mix of completely different syntaxes and concepts, so not really well usable without an assisting IDE I find
<beneroth>
e.g. db.Users.Where(u => u.age < 22).SelectMultiple(u => u.Siblings).OrderBy(u => u.age); -> returns an iterator/cursor into the SQL DB.
<beneroth>
db.Users.Where(u => u.age < 22).SelectMultiple(u => u.Siblings).OrderBy(u => u.age).ToList(); -> returns a list of objects in memory
<Regenaxer>
:o
<beneroth>
some statements are not allowed within the anonymous functions depending if its a list in memory or if it mapped/generates to a SQL query
<beneroth>
a mess
<beneroth>
but yeah, one step closer to approximate some lisp and even graph DB functionality
<beneroth>
Java introduced similar things afaik, but I don't program nor follow Java much
<Nistur>
beneroth: Linq is all good and everything, but it makes some god awful looking C# code
<Nistur>
and a pain in the neck to debug when you chain it all like that
<aw->
tankf33der: haha +1
<aw->
thanks
<beneroth>
Nistur, exactly
<beneroth>
and I find it extremely ugly that it might look the same, but works (and is!) something completely different depending on context
<beneroth>
but that is an issue with other stuff in C# too
<beneroth>
e.g. Razor C# (C# used in the HTML pages of an web application) is different from usual C# (e.g. no foreach loop)
<Nistur>
I have zero experience with that
<Nistur>
I've used a bit of Linq because it adds a bunch of functionality to collections that was missing, but I use it VERY sparingly
<beneroth>
and me personally I also hate non-technical limitations like "you are not allowed to change a list you are currently iterating over". yeah can be a trap, but well I used to know what I do.
<beneroth>
s/I used/I'm used/
<beneroth>
C# is for the enterprise drones to get stuff done without being able to blow much up.
<aw->
Regenaxer: there's an unexpected behaviour in 'allowed <-- if called without arguments, it resets *Allow to (NIL)
<aw->
shouldn't it check for an Lst before doing (cons NIL NIL) ?
<Regenaxer>
oh, haha, well this makes not much sense
<Regenaxer>
'allowed' *always* sets to the argument(s)
<Regenaxer>
NIL is just one special case
<beneroth>
it's not a check, it is a specification
<beneroth>
(whitelisting)
<aw->
hmmm
<aw->
so, (allowed) essentially blacklists everything
<aw->
by design?
<Regenaxer>
If *Allow is not empty, it is a whitelist
<Regenaxer>
if it is empty, everything is allowed
<beneroth>
so can go wrong easily, eh? :P
<aw->
if *Allow is (NIL), it is a whitelist of nothing = blacklist
<aw->
blacklist of everything*
<beneroth>
that would be more consequent
<aw->
whitelist of nothing
<aw->
ok just checking
<beneroth>
but as I understand Regenaxer, the *Allow mechanics changes behaviour when *Allow is NIL
<aw->
seems dangerous to programmatically call (allowed)
<aw->
beneroth: no, when *Allow is (NIL)
<beneroth>
ah!
<beneroth>
wow
<aw->
it works fine when it's NIL
<beneroth>
ok
<aw->
no big deal, i just wanted to be sure it wasn't a mistake
mtsd has quit [Quit: Leaving]
<beneroth>
aw-, maybe do (redef allowed Lst (ifn Lst (quit "(allowed) called without arguments") (apply 'allowed Lst)) to secure against this programmer mistake?
<beneroth>
you could put this redef into a separate script you only load for testing/pre-production, and leave it away in production code (overhead)
<beneroth>
I haven't tested if the redef above is actually correct, but you get the idea ;)
<Regenaxer>
I think he would quickly notice without the redef
<Regenaxer>
"not allowed" messages
<beneroth>
ah, I misunderstood
<beneroth>
so (off *Allowed) -> everything allowed. but (allowed) equals (setq *Allowed '(NIL)) -> empty blacklist, nothing allowed
<beneroth>
ok
<beneroth>
thanks for the correction
<aw->
beneroth: yes
<aw->
no need to redef, i just choose to define (allowed) with hardcoded list instead ;)
<aw->
less dangerous
orivej has quit [Ping timeout: 276 seconds]
orivej has joined #picolisp
alexshendi has joined #picolisp
alexshendi has quit [Ping timeout: 240 seconds]
alexshendi has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]