; started thinking about something like set-words get-words in factor (like rebol has) ; which enables you to steal (set) values from middle of flow (function pipeline) ; in case you need to reuse it later ; :set-word --- like "set-word" set now ; get-word: --- like "get-word" get now ; :word -> #word --- so word definition has to change ; rebol example -- couldn't find any better at this time (you see I am using that r: in the middle of expression... ; it sets r word and passes value forward show-payment-history: func [ user /local R ] [ html-table rejoin [ html-table-row [ "Številka predračuna" "Številka računa" "Datum" "Mesecev" "Datum" "Znesek" "Plačano do" "Opombe" ] "th" either not empty? r: accumulate x acc copy "" (get-user-data-of "payments" user) [ join acc html-table-row reduce [ x/order-id x/inv-id (get-plan-name x/plan) x/months x/when x/amount x/payed-to x/notes ] "td" ] [ r ] [ wrap wrap "No payments yet." "td colspan='8'" "tr" ] ] ] ;some very light stack manipulators.. #. drop ; #.. drop drop ; #* dup ; #** dup dup ; #^ swap ; -- pull the second in stack to the front #-^ -- pull the trird on the stant on the front #--^ #.- #.-- #email-data ( id :email. -- data ) "http://www.data.com/" ^ append load lines * first :title . rest [ ";" ^ split ] map [ ** 2 pick ^ 5 pick average ^ 9 pick difference ] map >csv email: title: send-email ; #sign-in ( user pwd -- userdata message ) get-user-data :data null? [ "try again" ] [ "welcome" data: name>> append ] either data: ^ ; #add-item ( category-name name qty -- ) --^ * get-category-id-by-name * null? [ . add-category ] [ .- ] either add-item ; #add-item ( category-name name qty -- ) --^ * get-category-id-by-name :catid null? [ add-category ] [ catid: ] either add-item ; ; simplistic style programming with (toomany) variables .. bad example I know ; var a = .. ; var b = ... ; return f(a,b); #get-asda ( user month type -- report ) ^ get-month-name :m-name . ^ get-user-data :user-data . m-name: user-data: generate-report ;