<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font size="+1">Hi, <br>
</font></p>
<p><font size="+1">Does one of you know how to import code contained
in a string?</font></p>
<p><font size="+1">The string contains a class definition with
method. I use to it that way with Pharo:<br>
</font></p>
<pre><font size="+1">parseScript: drgeoNode
"First do one pass to compile all the script Smalltalk source code"
drgeoNode elementsDo: [: node |
(node tag = #value and: [(node attributeAt: #type) = #script]) ifTrue:
[CodeImporter evaluateString: (node contentStringAt: #code)]]
</font></pre>
<p><font size="+1"><br>
</font></p>
<p><font size="+1">The string content from an XML file (does YAXO
parse entities?):<br>
</font></p>
<p><font size="+1"><font face="monospace">DrGeoUserScript subclass:
#DrGeoScript126328658 	instanceVariableNames:
'' 	classVariableNames:
'' 	poolDictionaries:
'' 	category:
'DrGeoII-User'! !DrGeoScript126328658 commentStamp:
'<historical>' prior:
0! ! !DrGeoScript126328658
methodsFor: 'public' stamp: 'HilaireFernandes 12/9/2014
15:28'! compute "Edit
me" 	^[:x | x cos ]!
! "-- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- --
"! DrGeoScript126328658
class 	instanceVariableNames:
''! !DrGeoScript126328658 class commentStamp:
'<historical>' prior:
0! ! !DrGeoScript126328658
class methodsFor: 'public' stamp: 'HilaireFernandes 12/9/2014
14:50'! description 	^'The function to
be plotted. Return a bloc of code'!
! !DrGeoScript126328658 class methodsFor:
'public' stamp: 'HilaireFernandes 12/9/2014
14:43'! scriptName 	^'Function'!
! !DrGeoScript126328658 class
methodsFor: 'private' stamp: 'HilaireFernandes 12/9/2014
14:43'! newArgumentsType 	^{}!
! </font><br>
</font></p>
<p><font size="+1">Thanks<br>
</font></p>
<pre class="moz-signature" cols="72">--
GNU Dr. Geo
<a class="moz-txt-link-freetext" href="http://drgeo.eu">http://drgeo.eu</a>
<a class="moz-txt-link-freetext" href="http://blog.drgeo.eu">http://blog.drgeo.eu</a></pre>
</body>
</html>