« first day (4280 days earlier)      last day (675 days later) » 
00:00 - 05:0005:00 - 00:00

12:04 AM
lmao... no everyone is free of charge... you didn't read my :p properly
just remember, we all have jobs to do or other things to worry about than your specific problem
you mentioned 3 options... did you try them out for instance?
 
I retagged this from python-3.x (only); please help me hammer it stackoverflow.com/questions/55847201 (SOCVR doesn't care about questions without other recent activity)
 
@OneRaynyDay I don't understand what you'd need this for. What functions would you have the metaclass create?
 
I totally understand @ jobs and other obligations :) I don't expect anyone to e.g. make a parser and implement the 3 options and get back to me on what is the optimal approach. Just wanted to know if anyone has run into this and can save me significant regret by sharing their experience

regarding the 3 options, I worked on compilers at work and we don't mainly use visitors to, e.g. transform 1 AST to another. I've taken some compiler classes (a long time ago) where I wrote the visitor by hand and it was pretty painful. I also tried 1) already and wasn't too happy w/ the lack of ide support
@Aran-Fey if you have nodes X,Y,Z, you can have a metaclass A that they all inherit from where you can override __new__ and modify the classdict to include extra fns, or just setattr() the created class with this fn
 
@KarlKnechtel done
 
these would be the def visit(visitor) functions required from a visitor
and then you can also do the same thing on the visitor class with some metaclass B that keeps track of all nodes X,Y,Z and setattr on the visitor to generate visitX(), visitY(), visitZ()
 
12:15 AM
sounds like you'e sounded out the idea... why not show some code so others, if they wish, can critique that?
anyway - bed time... rbrb
 
What would those functions do, though? Would visitX, visitY and visitZ just do pass?
 
they would initially do pass as it's meant to be an interface that others can specify behavior for
I'm actually not sure if this is how python's libast works, since they also have visitX for every node
one sec, checking if it's codegened
looks like it is, but it also comes w/ its own custom grammar language just like ANTLR
here's the library as-of right now: github.com/OneRaynyDay/treeno without a visitor
here's a long shpiel on why this library should exist: github.com/trinodb/trino/discussions/10410
 
12:47 AM
stackoverflow.com/questions/67323995/… the title is such a strange way to describe the problem.
(I am in the process of cleaning up and hammering/re-hammering a lot of stuff)
@JonClements one more, please? stackoverflow.com/questions/35372657
stackoverflow.com/questions/65791230 good lord, someone actually attempted this interoperation once
 
1:05 AM
@KarlKnechtel umm... if you're on a "mission" as it were... put together and share something like a gsheet doc
I can't guarantee I have time but if you include the post link, a destination link, and a reason why etc... I'll get around to it eventually
 
1:21 AM
I think I'm most of the way through honestly x.x
most of what I'm doing does require manual review, is the thing
 
1:33 AM
@JonClements I'm sorry, I got confused with that code in Ruby (I don't know anything about Ruby). For some reason I thought that 'f' was a variable. Interesting to know that Ruby allows you to insert expressions into a function without using a variable.
 
@Marco nah... if it "runs off the end" - it does the "last expression" kinda thing as return instead of "None"
f there is a function
 
got it, interesting anyway
thanks
 
jon@minerva:~/development/testing$ cat test.rb
def cabbage number
	if number > 10 then
		return 'more than 10'
	end
	2 + 2
end

puts cabbage 5
puts cabbage 11
puts cabbage 9
jon@minerva:~/development/testing$ ruby test.rb
4
more than 10
4
 
uhh
strange
 
1:41 AM
after some time thinking I am able now to understand the behavior of the '2 + 2' print
 
if there's no explicit return - it's the last evaluated statement
def cabbage(number):
    if number > 10:
        return 'more than 10'
    return 2 + 2
it's basically that
jon@minerva:~/development/testing$ cat test.rb
def cabbage number
	if number > 10 then
		return 'more than 10'
	end
	#2 + 2
end

puts cabbage 5
puts cabbage 11
puts cabbage 9
jon@minerva:~/development/testing$ ruby test.rb

more than 10
else it just falls off the end as Python does and returns nil
 
1:58 AM
if I try searching for site:stackoverflow.com python join strings in either DDG or Google (incognito), I can't easily find the canonical (stackoverflow.com/questions/12453580/…).
 
@Karl do we have anything on sopython.com/canon ?
 
doesn't look like it. closest I can find is sopython.com/canon/32/using-a-list-comprehension-with-str-join which is nowhere near as significant and also not high quality
Okay, I'm done for now. There were only three questions outstanding where I can't hammer them due to the tag thing.
however, more interesting is a batch retagging job I'd like to request.
 
if you login..,. you should be able to edit sopython.com/wiki/Karl%27s_ideas
consider it a scratch pad or something
 
for links to put in the canon?
 
yup
I'd need some consensus from the other RO's to enable access to edit canonicals - but if you start there maybe?
it supports markdown
 
2:13 AM
mm
honestly that's not my highest priority thing at the moment; I'm more interested in figuring out whether we have canonicals, deciding what should be canonical, and creating what's missing

publicizing the results is kinda secondary
 
oh scratch that... you're already an editor
I'll delete that post
 
oh yeah I straight up have a 'create common question' button
I'll have to remember that
 
so create a wiki thingy - put yours ideas into it
so we don't loose track of your ideas
then we can work on the CQ stuff later or something?
 
2:54 AM
My ideas are already being tracked on my GitHub.
er, the CQ stuff is.
I'm not really sure what other ideas I have a lot of :)
 
3:05 AM
@JonClements right
@JonClements yeah
 
3:36 AM
https://stackoverflow.com/questions/24839305
https://stackoverflow.com/questions/72854452
Another common pattern of misunderstanding: expecting a function call to work like a goto
(you can probably find a lot more examples by searching for questions about that one particular exercise from LPTHW)
 
4:07 AM
(I'm aware, but people who try to design "adventure games" commonly invent the same problem)
(and in fact Zed actually tries to point people at a solution, it's just that the overall pedagogy is so bad)
 
00:00 - 05:0005:00 - 00:00

« first day (4280 days earlier)      last day (675 days later) »