« first day (1128 days earlier)      last day (3353 days later) » 

 
1 hour later…
3:06 AM
@Jens 祝你在新的一年里,一帆风顺,二龙腾飞,三羊开泰,四季平安,五福临门,六六大顺,七星高照,八方来财,九九同心,十全十美,百事亨通,千事吉祥,万事如意
 
 
2 hours later…
4:39 AM
This is not what I should be doing dropbox.com/s/5vszbpak06xq9ag/game.mp4?dl=0
 
 
4 hours later…
8:09 AM
@Rojo you've done that? :)
 
 
3 hours later…
11:38 AM
@Kuba Yea
 
@Rojo +1 :)
 
@Kuba Just trying stuff. Had to use shift and control for left and right, because I don't think there is a CurrentValue[LeftArrowKeyDown]
 
Hey guys, I am trying to setup a function that performs some stuff but I'm trying to generate a warning in case the argument of the function is not recognized. If a warning is generated, it stops any evaluation that comes after. Something like
`myfunction[arg_]:=Block[{list}, list={a,b,c}; Which[Position[list, arg] === {}, Message[myfunction::warn, arg]; Abort]; [do other stuff] ]`

A simple `If[]` would work there, but I was just trying to avoid having everything inside an `If[]`. Maybe there exists a `If[]` that doesn't require my providing an argument for the `[else]` part? Something l
 
@Sosi what are abc?
 
@Sosi myFunction[arg_]:= With[{list = {a,b,c}}, [do other stuff] /; MemberQ[list, arg]] ?
 
11:50 AM
@Kuba just a working example. In this case, I would write myfunction[a] and "other stuff" would be evaluated. But if I wrote myfunction[y] it would abort and return a warning
 
_myFunction:=(Message[...];Abort[])
 
but those symbols are supposed to have values?
 
@kuba no, I will literally provide just those symbols there. They don't even need to have values before, just need to exist in that list.
@Rojo that would evaluate [do other stuff] if MemberQ[list,arg]] is true correct? And where would you put the warning?
 
@Sosi In a separate value of myFunction
 
(also, thanks for the MemberQ, didnt remember that)
oh, ok, let me try it out
 
11:55 AM
@Sosi The first definition won't just not evaluate [do other stuff] if arg isn't in list. It also won't match the myFunction definition, so it will try with th enext one
 
oh, I see now!
@Rojo thanks!
 
@Sosi Its like short form of:
myFun[arg_]:= myOtherFun[arg, {a,b,c}]
myOtherFun[arg_, as_List]/;MemberQ[as, arg] := [do other stuff]
myOtherFun[__]:= (Message[...];Abort[])
 
@Rojo just one more question (and sorry, this is a simple question but I'm still learning to work with functions): what is the correct syntax to have multiple evaluations inside that [do other stuff]? Say that it would correspond to having With[{list = {a,b,c}}, {a=2; b=3; b*a^2} /; MemberQ[list, arg]]
I'm trying something like that but it isn't working :(
 
@Sosi Just (a=2; b=3; ba^2) if you don't need the list. If you don't put the parentheses, all but the last (ba^2) will be evalauted before checking MemberQ[list, arg]
 
@Rojo many thanks! :)
@Rojo it worked! :) many many thanks!
 
 
12 hours later…
11:59 PM
@OleksandrR. Are you around by any chance?
 

« first day (1128 days earlier)      last day (3353 days later) »