How to refactor a Symbol in Dolphin

In my application I'm using Symbols as placeholders for Strings to 
provide multi language support. To refactor the symbol names I wouuld 
like to click on my Symbol in the MethodWorkspace and start refactoring 
with an hit on F2. But the refactor dialog shows the active method name 
and not the symbol.

Is there an other way to refactor symbols.

At the moment I have to define a method with the same name as my Symbol 
saving it. Refactor the symbol method and deleting the method. Most 
times I like to refactor a bunch of symbols. So this way is very 
unconvinient.

Any suggestions appriciated.

thanks
cjb
0
Christoph
12/12/2009 10:35:49 AM
comp.lang.smalltalk.dolphin 3703 articles. 0 followers. Post Follow

6 Replies
176 Views

Similar Articles

[PageSpeed] 52
Hi!

Maybe you should use PoolDictionaries (and write keys) instead of
symbols. I don't say that PoolDictionaries are the best solution but
are comparable with your current implementation.

Another solution we have implemented is using Strings, but no as
placeholders. String was extended with #translated implementing the
translation logic for the current language of the user.
i.e.

'Helo' translated  -> If the user has english as language, #translated
answers 'Hello', but 'Hola' if the user is in spanish.
'I'm <1d> years old' translated expandMacrosWith: 20 (on my dreams) ->
'Tengo 20 a=F1os' if the user is in spanish

All the translations are mantained in a LookupTable that can be
exported in xml.

Additionally we mark all the translatable strings with the character @
as the first character so find all translatable strings
is as easy as "String allInstances select: [:each | each firstOrNil =3D=3D
$@]".
Using this technique you should remove @ as the first character in the
#translate implementation of String (If you mask @ with @ i.e.
'@@domain' you ends with '@domain' so there are no problems).

Cheers
Sebastian Calvo



On 12 dic, 07:35, "Christoph J. Bachinger" <bachinger.softw...@t-
online.de> wrote:
> In my application I'm using Symbols as placeholders for Strings to
> provide multi language support. To refactor the symbol names I wouuld
> like to click on my Symbol in the MethodWorkspace and start refactoring
> with an hit on F2. But the refactor dialog shows the active method name
> and not the symbol.
>
> Is there an other way to refactor symbols.
>
> At the moment I have to define a method with the same name as my Symbol
> saving it. Refactor the symbol method and deleting the method. Most
> times I like to refactor a bunch of symbols. So this way is very
> unconvinient.
>
> Any suggestions appriciated.
>
> thanks
> cjb

0
GallegO
12/12/2009 2:20:35 PM
Christoph J. Bachinger wrote:
> In my application I'm using Symbols as placeholders for Strings to
> provide multi language support. To refactor the symbol names I wouuld
> like to click on my Symbol in the MethodWorkspace and start refactoring
> with an hit on F2. But the refactor dialog shows the active method name
> and not the symbol.
> 
> Is there an other way to refactor symbols.
> 
> At the moment I have to define a method with the same name as my Symbol
> saving it. Refactor the symbol method and deleting the method. Most
> times I like to refactor a bunch of symbols. So this way is very
> unconvinient.
> 
> Any suggestions appriciated.

You can use the Code Rewriter if you want to rename the symbols. For
example, to rename #foo to #bar: select your packages, switch to the
code rewriter, enter #foo at the top, #bar at the bottom, and hit the
Replace button. This will open another window with all of the potential
changes that you can accept or reject.


John Brant
0
John
12/12/2009 3:11:16 PM
Hi John,

How to select the packages or only one Package. Normaly im using the 
Sytembrowser to code for my application. So my Package is already 
selected. If I switch to the Code Rewriter I can change the #foo to #bar
and hit the Replace button. But the change is only in this method and 
not in the Package or Class.

cjb

John Brant schrieb:
> Christoph J. Bachinger wrote:
>> In my application I'm using Symbols as placeholders for Strings to
>> provide multi language support. To refactor the symbol names I wouuld
>> like to click on my Symbol in the MethodWorkspace and start refactoring
>> with an hit on F2. But the refactor dialog shows the active method name
>> and not the symbol.
>>
>> Is there an other way to refactor symbols.
>>
>> At the moment I have to define a method with the same name as my Symbol
>> saving it. Refactor the symbol method and deleting the method. Most
>> times I like to refactor a bunch of symbols. So this way is very
>> unconvinient.
>>
>> Any suggestions appriciated.
> 
> You can use the Code Rewriter if you want to rename the symbols. For
> example, to rename #foo to #bar: select your packages, switch to the
> code rewriter, enter #foo at the top, #bar at the bottom, and hit the
> Replace button. This will open another window with all of the potential
> changes that you can accept or reject.
> 
> 
> John Brant
0
Christoph
12/13/2009 4:49:34 PM
Hi GallegO

> Maybe you should use PoolDictionaries (and write keys) instead of
> symbols. I don't say that PoolDictionaries are the best solution but
> are comparable with your current implementation.

The symbols are the keys in the dictionary of the langugage instance.

> 
> Another solution we have implemented is using Strings, but no as
> placeholders. String was extended with #translated implementing the
> translation logic for the current language of the user.
> i.e.
> 
> 'Helo' translated  -> If the user has english as language, #translated
> answers 'Hello', but 'Hola' if the user is in spanish.
> 'I'm <1d> years old' translated expandMacrosWith: 20 (on my dreams) ->
> 'Tengo 20 a´┐Żos' if the user is in spanish
> 
> All the translations are mantained in a LookupTable that can be
> exported in xml.
> 
> Additionally we mark all the translatable strings with the character @
> as the first character so find all translatable strings
> is as easy as "String allInstances select: [:each | each firstOrNil ==
> $@]".
> Using this technique you should remove @ as the first character in the
> #translate implementation of String (If you mask @ with @ i.e.
> '@@domain' you ends with '@domain' so there are no problems).

The idea is not bad. But I don't like to change the horse at the end of 
a development.

Thanks
cbj

> 
> Cheers
> Sebastian Calvo
> 
> 
> 
> On 12 dic, 07:35, "Christoph J. Bachinger" <bachinger.softw...@t-
> online.de> wrote:
>> In my application I'm using Symbols as placeholders for Strings to
>> provide multi language support. To refactor the symbol names I wouuld
>> like to click on my Symbol in the MethodWorkspace and start refactoring
>> with an hit on F2. But the refactor dialog shows the active method name
>> and not the symbol.
>>
>> Is there an other way to refactor symbols.
>>
>> At the moment I have to define a method with the same name as my Symbol
>> saving it. Refactor the symbol method and deleting the method. Most
>> times I like to refactor a bunch of symbols. So this way is very
>> unconvinient.
>>
>> Any suggestions appriciated.
>>
>> thanks
>> cjb
> 
0
Christoph
12/13/2009 4:58:58 PM
Christoph J. Bachinger wrote:

> How to select the packages or only one Package. Normaly im using the
> Sytembrowser to code for my application. So my Package is already
> selected. If I switch to the Code Rewriter I can change the #foo to #bar
> and hit the Replace button. But the change is only in this method and
> not in the Package or Class.

You'll need to deselect your class/method. Otherwise, it will run on
only the class/method that you have selected.


John Brant
0
John
12/14/2009 1:16:35 PM
John Brant schrieb:
> Christoph J. Bachinger wrote:
> 
>> How to select the packages or only one Package. Normaly im using the
>> Sytembrowser to code for my application. So my Package is already
>> selected. If I switch to the Code Rewriter I can change the #foo to #bar
>> and hit the Replace button. But the change is only in this method and
>> not in the Package or Class.
> 
> You'll need to deselect your class/method. Otherwise, it will run on
> only the class/method that you have selected.

Sorry to be so annoying to you, but I see only one method in the list 
while if I do a shift F12 I see much more senders of my Symbol but this 
is in a Methodbrowser and not in the code rewriter methodlist.

Deselection the only message highlights all menu entries without "Accept 
all changes". Selecting it does only a change in the one method listed.

cjb
0
Christoph
12/14/2009 6:18:23 PM
Reply:
Similar artilces about - How to refactor a Symbol in Dolphin:

refactoring
I completely agree, that is somewhat deplorable, that Mathworks claims to come with an IDE and as Sander pointed out it has not the most basic re-factoring capabilities. I won't enter the discussion about what re-factoring is but instead I want to point out, that the GUI developpers of Mathworks would do good get some inspiration from something like IntelliJ (which probably even is used by you developers already) http://www.jetbrains.com/idea/features/refactoring.html Best Felix ...

Average symbol in LaTeX?
--Signature=_Thu__6_Jan_2005_12_07_22_+0100_+fyYlCGcCs1a2Xbv Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit Hello, I figured out quite a bad approximation of the average symbol with this code: $\not\!\circ \; x$ Any better ones? Thanks in advance! best regards Moritz Beller -- web http://www.4momo.de mail momo dot beller at t-online dot de gpgkey http://gpg.notlong.com --Signature=_Thu__6_Jan_2005_12_07_22_+0100_+fyYlCGcCs1a2Xbv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linu...

is there a "present value" symbol in LaTeX
Is there a "present value" symbol in LaTeX, as shown, for example, in this document? http://www.casact.org/library/studynotes/2_Notation-terminology.pdf I've Googled "present value latex", consulted "The LaTeX Companion" and searched a 2008 version of "The Comprehensive LaTeX Symbol List" by Scott Pakin. None of these efforts has located a "present value" symbol. Thanks for any help you can offer. Lewis On May 20, 1:49 pm, cl...@yahoo.com wrote: > Is there a "present value" symbol in LaTeX, as shown, for example, in > t...

How to define a matrix symbol?
I want to define a symbol and designate it as a matrix, not a scalar. What should I do? Frank Chen: <SNIP wants to create sym-matrices... one of the many solutions m=magic(4); sm=sym(m) % -or- sn=sym; sn(3,3)=pi us OK. I'd better use an example. syms L1 L2 syms X21 syms Y Y = [L1, 0; X21, L2]; Y*Y' retruns ans = [ L1*conj(L1), L1*conj(X21)] [ X21*conj(L1), X21*conj(X21)+L2*conj(L2)] Obviously those variables are treated as scalars. But I want to define them as matrices, what should i do? BTW, how to say 1+...+n^2 symbolically? syms n simple(sum([1:n].^2))...

help with guarding the $ symbol as I need to output the $ symbol as well.
HELP. NOTE. $arg is really just the argument $1.. sqloutput() { outfile="${arg}.txt" echo "inside sqloutput, outfile is:$outfile" alternative_out="alt.txt" alternative_out2='alt$alt.txt' sqlplus -s scott/tiger << EOJ $SETOFF set sqlcase upper spool $outfile -- spool $alternative_out @fmt_select spool off $SETON quit EOJ } description of the problem: wk$lang is an oracle table. sqlunldr 'wk$lang' table2 table3 .... is what i will run on the command line, sqlunldr is the KSH script which I'm trying t...

[refactoring] What are your favourite refactorings?
Hallo, I would like to know what your favourite refactorings are. The reason is that I want to learn these one first, because I think they are more used than the others. Thank you for any answer Klaus > I would like to know what your favourite refactorings are. * Extract Method. * Rename X, where X is any of Variable, Class, Method, etc. * Also: Extract Method. :) Laurent http://bossavit.com/ > I would like to know what your favourite refactorings are. > > The reason is that I want to learn these one first, because I think > they are more used than the others. - Rename...

Symbol for engineering powers (ie x10^3)
Hi all, I was just wondering if there is a more attractive way of doing something like this: $50\times10^{12}$ it produces large gaps between the 50 and the 10, which I personally don't like. Is there perhaps a symbol the encompasses the whole 'x10'. Many thanks. Andy Andrew Greensted wrote: > Hi all, > > I was just wondering if there is a more attractive way of doing > something like this: > > $50\times10^{12}$ > > it produces large gaps between the 50 and the 10, which I personally > don't like. Is there perhaps a symbol the encompasses...

PledgeWare: Dolphin 7 and 64 bit Poll Results
Hi folks, It's been a good few weeks since I put out the call for pledges to support upgrading the Dolphin VM to 64-bit and to release a new version of the IDE as Dolphin 7. So, I thought you might like to know the results. The response has been very good and it certainly shows that a fair number of you out there are using Dolphin for some quite sophisticated "heavy lifting" applications. I was surprised by the number of people willing to pledge $1000 or over for the 64-bit version. However, the aim of the poll wasn't to find the maximum price but rather a p...

symbolic exression
why symbolic expression in form of a^2^3 or a^(1+x)^2 (two ^ operation contineously) is invalid? thanks ...

Keeping symbols together
I have the following "derived" symbol, \def\ci{\perp\!\!\!\perp}. However, sometimes a line break splits to two symbols. Is there a way to always keep the symbols together? thanks Tim "Timothy W. Victor" <tvictor@dolphin.upenn.edu> writes: > I have the following "derived" symbol, > \def\ci{\perp\!\!\!\perp}. However, sometimes a line break splits to > two symbols. Is there a way to always keep the symbols together? Enclose them in a box. -- Maurizio Loreti http://www.pd.infn.it/~loreti/mlo.html Dept. of Physics, Uni...

RE: Symbolic Derivatives of Unspecified Functions
Misha, I'm not certain if I'm following everything you are asking, but I think the following might help. You want to use the Derivative statement. So in the following I define a derivative operator that is the derivative of an unspecifed function with respect to the first argument plus the derivative with respect to the second argument. op1 := Derivative[1, 0][f] + Derivative[0, 1][f] We can then apply this to a set of arguments and then use the Through command to push the arguments onto the Derivative commands and then finally specify a specific function for f. op...

refactoring
Hi, I use VB.net express and I have installed the Refactoring program from Microsoft. When I make a program in VB.net I try to use refactoring but I don't see this program in the IDE. How can I use this program Refactoring to examine what I have make. Thanks for any response On Fri, 24 Mar 2006 17:58:11 GMT, "andrews" <andrews@microsoft.com> wrote: >Hi, >I use VB.net express and I have installed the Refactoring program from >Microsoft. Almost everybody in this newsgroup is using VB6 or lower. While you may get a stray answer to VB.NET (including VB2003 and...

[ANN] Ruby Refactoring Browser 0.0.3
Hello, Ruby Refactoring Browser 0.0.3 has been released. This tool helps developers to modify code like renaming variables and extracting method. http://www.kmc.gr.jp/proj/rrb/index-en.html Features: * Emacs interface and FreeRIDE plugin * Suitable undo on Emacs interface * And here is available refactorings * Rename local/instance/global/class variable * Rename method * Rename constant, including class name and module name * Pull up/Push down method * Extract method * Extract superclass -- OHBAYASHI Ippei http://www.kmc.gr.jp/~ohai/ Kyoto University Micro...

dolphin professional 5
I'm working on a large free software project that requires a 3D engine. Since I want to use a halfway decent language, I picked ST3D. Which means using Dolphin; I'm currently using VWNC. This being a free project, I don't have a lot of money to spend. Someone already gave me their old license for Dolphin 4.0, but if I understand things then that version doesn't have the refactoring browser. Does anyone have a license to Dolphin 5.0 Professional they're not using? For details of the project, see http://www.c2.com/cgi/wiki?ObjectBrowser You need Dolphin Smallta...

Printing Special Symbols
I have a need to print from D3 basic programs the registered trademark symbol (letter R within a circle) and the copyright symbol (letter C withing a circle). Can anyone point me in the right direction on this? I have printed all the standard ascii characters from zero to 250 and the characters do not exist. Ron White ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =---- I would think it depend...

Re: Typing special symbols in text mode?
On 4/1/06 at 5:39 AM, rex.eastbourne@gmail.com (Rex Eastbourne) wrote: >I'm writing a problem set and would like to use special >mathematical notation such as vector arrows, the special R for >reals, subscripts and superscripts, and so on (both in equations >and in English regular text comments). This would be easy to do in >LaTeX, but can it be done in Mathematica? (I know about the "export >to TeX" feature, but it would be nice not to have to go back and >change notation after exporting to TeX.) The answer to your question "can this be don...

Symbolic expressions #3
I need to define a positive symbolic expression say 'n'. I am using 'sym' or 'syms' (for multiple symbols). In one machine (PC) it is working fine but in another following error is coming: ?? Undefined function or method 'sym' for input arguments of type 'char'. what may be the reason? i am using same version in both the systems. Is there any other way of defining math symbols? "Shishir Jaiswal" <shishirjaiswal_18@yahoo.com> wrote in message news:kfo3oq$44e$1@newscl01ah.mathworks.com... > I need to define a positive s...

"|" symbol means...???
Hi I came across come code today that I don't understand. I need to know if the use of the symbol "|" is interpreted by SAS to mean "given that" (as I would infer, if this were hand-written notes). If Vascul1=0 then do; if dx_3 '441' | dx_4 in ('4439' '7854' 'V434' 'v434') then do; macro blah blah; end; end; So does this mean that *BOTH* dx_3 = '441' *AND* dx_4 equal to one of the 4 options in the brackets would have to hold for the condition to be true??? Can someone please help me? Thanks, Machelle It mean...

[bug] Array#first(symbol) doesn't raise?
irb(main):001:0> %w(a b c).first(:xyz) => ["a", "b", "c"] irb(main):002:0> %w(a b c).last(:xyz) => ["a", "b", "c"] This seems inconsistent to me. I would expect a TypeError. -- Simon Strandgaard >>>>> "S" == Simon Strandgaard <neoneye@adslhome.dk> writes: S> irb(main):001:0> %w(a b c).first(:xyz) svg% ruby -we '%w(a b c).first(:xyz)' -e:1: warning: treating Symbol as an integer svg% Guy Decoux On Sunday 24 October 2004 15:25, ts wrote: > ruby -we '%w(a b c)....

Symbol \dj
Hi, is there a symbol like "\dj" that works in math mode? Regards, Stefan In article <f225b3$pe0$1@ariadne.rz.tu-clausthal.de>, "Stefan Pinnow" <stefan.pinnow@tu-clausthal.de> wrote: > is there a symbol like "\dj" that works in math mode? I can't find one, and it probably doesn't exist, since this glyph is generally only used for text. You could define a macro for it: \newcommand{\dbar}{\textit{\dj}} However, the spacing doesn't quite work out just right in some cases. The following seems to solve the spacing problem: \doc...

[refactoring] for-loops
Hallo, is there a good reason to replace for-loops? Is there a standard way how to replace them? I have seen MyClass.MoveNext or MyClass.HasNext constructions (also in Fowler). (Are these standard constructions in Java?) What are the reasons to replace a for-loop? What is the best way/method to do it? Is there a name for this refactoring? Maybe you could copy & paste a code snippet you wrote as an example here. That would help. Thank you for any answer Klaus I usually replace them with a for loop with only one message inside (one method). If that works, then I replace that with r...

Sbcl feature
Hi there! Darcs marks conflicts in a file with ************ ^ ^ ^ v v v but sbcl compiles such a file without warning. Is it ok? E.g. lispworks warn that "variable assumed special" In fact, it seem to be a bug, as v would lead to evaluation of v at load time, wouldn't it? And v is an unbound variable. With best regards, budden In article <2cf4cb62-c72b-4aec-9b3b-4f3ecb353a58@17g2000hsk.googlegroups.com>, budden <budden01@mtu-net.ru> wrote: > Hi there! > Darcs marks conflicts in a file with > ************ > ^ ^ ^ > v v v > > but sbcl com...

Refactoring of running other programs
--ELM1084312593-5525-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII As part of the work for making relocatable installs, I have re-factored all the code that looks for other binaries. I move FindExec into port/exec.c (and renamed it to find_my_binary()). I also added find_other_binary that looks for another binary in the same directory as the calling program, and checks the version string. The only behavior change was that initdb and pg_dump would look in the hard-coded bindir directory if it can't find the requested binary in the same directo...

How to install font/symbol packages (like ifsym) ?
Hello, It's so easy to generate and set up a new .sty file. But how can I install a font/symbol packages like _ifsym_ ? (especially in teTeX) I have tried this thread: http://www.tug.org/pipermail/tugindia/2001-August/000056.html But it does not work well. How can I do it correctly ? Thanks ! Yi Li Yi Li wrote: > It's so easy to generate and set up a new .sty file. > But how can I install a font/symbol packages like _ifsym_ ? > (especially in teTeX) Read the FAQ: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instfont and http://www.tex.ac.uk/cgi-bin/texfaq2html?lab...

emacs cl refactoring bookmarks org mode etc
Hi Just some elisp code that got me so excited I wanted to share :) Here's what got me to write this code: I am about to start a refactor of some of my CL code to add some functionality. This would need me to navigate to a couple of files to a couple of functions and make some notes about how I am going to change them. Essentially build a work plan to execute with links to the appropriate places. Plain emacs bookmarks don't work cause they have no descriptive context. Standard org mode has no help in creating the navigable bookmarks easily. So I came up with the following after ...