I implemented a funny experiment on top of Groovy: using my tool beginners
can completely program in their own language (I mean everything is
translated).
You can take a look of this experiment at: http://scrountch.info
the implementation is not extremely efficient (or well written) but I
consider
not a bug: a strange thing that happens when the code is started from inside
IntelliJ
(was confused because tested subclass of Console inside IntelliJ)
sorry
-
member of Grumpy Old Programmers
--
View this message in context:
if you write a very simple subClass of groovy.ui.Console
the output has then a very Strange behavior:
- if you create a String with "unusual" chars (I mean chinese or Arabic )
- if you "println" this string then you only get "?"
-but when printing the result it's ok
very annoying for me
well a last response to the initial message.
Though many may think it's useless to change the name of classes and methods
I succeeded in implementing a framework (for teaching) that just does that
... next step: may be change also the language keywords dynamically (please
don't shoot: don't shoot
OK forget it: after careful binary sieve of the code I found a cast (by "as")
which failed at runtime!
the message is strange but stranger things happen!
-
member of Grumpy Old Programmers
--
View this message in context:
strange: I thought I didn't change anything in my code () and then suddenly I
get this:
this part of the code being run at load-time I just can't figure what's
happening (line 68 has no such deal with Path2D though it appears a lot of
time in the code)
any idea on how to make changes?
by the way doing this by changing the .properties file description with such
a protocol
-
#properties file
java.awt.geom.Area#isEmpty() = estVide
java.awt.geom.Area#contains = contient
-
now this code does not work!
the key name is parsed
missing the code parts ? sorry
ok I try again
// this part read from a resource so simplifying
String className = 'java.awt.Canvas'
String originalMethodName = 'repaint'
String newMethName = 'repeindre'
Class clazz =
a code example?
well almost everything is in the initial post
I read the resource I get the name of a Class, the name of a method and the
name for the alias for this method
the code will add the alias to the metaclass of the named class (suppose
this class to be "java.awt.Frame")
later user of the
to aseem: I willl publish my codes as open source
(because I think it is important to teach in your own language
BTW: arabic is a problem to me because I no not know how students could
handle bidirectional code text)
in the meantime here is the subclass of groovyConsole:
I have also a trait
answer found
Groovy is fantastic!
Since I use the groovyConsole for my teaching scripts
I created a subclass of groovy console
then modified the CompilerConfiguration to accept an importCustomizer that
aliases import!
fun!
-
member of Grumpy Old Programmers
--
View this message in context:
Thanks for replying
as a side note OOP appear only in chapter 8 of my book so I have to survive
in the meantime
A long long time ago I used object logo ... sticking to groovy helps me to
provide the additional codes I want to create simplistic graphics.
now back to the main point:
when I read
Before asking a question I'l have first to explain WHY this question.
I have been writing a book about programming (for beginners)
For the labs I use a small subset of Groovy
now my labs are slightly boring so I decided to write a small graphical
library to facilitate the design of
13 matches
Mail list logo