transforming destructive to none-destructive functions ?

Started by didi, September 14, 2007, 11:26:26 AM

Previous topic - Next topic

didi

( replace "X" (eval button-cmd-string) xname )



This is what worked, but i guess there is a better way to eg. create a non-destructive replace .  





; <><><><><><><><><><><><><><><><><><><>



PS: long time no see - while having only little time for hacking , i'm trying to simplify the gui-programming for me . This works already :



( mgs:gui-intro )

( mgs:make-frame "my-app" 5 5 90 45 )  ; the size in % of screen can be left

( mgs:tool-bar )

( mgs:add-button  "Run" "Stop" )

( mgs:gui-start )



... probably the rest will take some weeks more ;-)  .. but i'll stay tuned to newLISP fanclub

Jeff

#1
Redefine it in a function.  A function will copy the value and return the destroyed (copied) value.
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code

cormullion

#2
I use (string):



(set 's "didi")

(replace "i" s "a")

(println s)

;-> "dada"



(set 's "didi")

(replace "i" (string s) "a")

(println s)

;-> ;-> "didi"

didi

#3
Thanks !   I use the string-function now .