last day (3525 days later) » 

7:06 PM
Hi :)
This is probably a better location for this discussion - was just thinking I'd make an F# room, but saw you already did ;)
@NETscape Want to move the discussion about F# here?
 
ahh yes
 
Thanks ;)
The reason I'm using a quotation here: let firstName = self.Factory.Backing(<@ self.FirstName @>, "")
is that I"m not actually trying to evaluate self.FirstName
but rather provide a quotation, that is then used by the framework to automatically pull out a string ("FirstName") to be used for raising PropertyChanged notifications when that backing field is set
which is why the property can be simple: member x.FirstName with get() = firstName.Value and set value = firstName.Value <- value
firstName.Value <- value sets the backing field's value, but also causes PropertyChanged to be raised
I also use it when I create the command - there I provide a list of quotations (Expr list) to the function that creates a command
and that's used to listen to property changed, and if any of the properties mentioned are raised, it triggers CanExecuteChanged on that command
 
what do you mean "pull out a string"
is that similar to reflection? same idea?
 
Have you looked at code that uses expression trees to get a property name?
For example, for a C# equivelent (ish), see: pochet.net/blog/2010/06/25/…
 
7:14 PM
i don't think so. i should have been more clear. I got through the getting started and advanced topics
 
(This is C# from that link) OnPropertyChanged(() => UseDelegate); is passing an Expression<Func<T>> into that method
and the expression tree is parsed to just pull out the property name at runtime
so you don't have to hard code the strings into the code
I'm doing something similar
An F# Quotation can be used, in this case, to extract out a PropertyInfo, which lets you use reflection to get the name of the property
The difference is that, in my library, it only happens one time, at construction, not every time the property is changed
Does that make sense at all?
 
i'm not ignoring you, just making sure i'm understanding everything. one sec
 
7:37 PM
i guess i am doing two things at once, ahhh.
this project (C++)... looks like it might be my paths
ooohhhhh i gotttt it...
my eyes are all funky. camel casing was playing jokes on my brain. i didn't sleep last night
that's pretty cool now that i see it
 
8:36 PM
:)
 
what's a good way to learn attributes... it seems like there are a million out there, both for C# and F#
I'm assuming [<_______>] is an attribute in F#
 
yes
for the most part, you shouldn't really use or need attributes, IMO, unless you are doing something specific
I think people tend to abuse them more often than not
 
okay.
another question
is tryfsharp.org open source?
 
mmm - I don't remember if the silverlight source is available
but it's basically just F# interactive, wrapped up in silverlight
and F# (compiler/tooling/etc) is all open source
 
i was hoping to keep going with lessons during the drive but won't have an internet connection
 
8:44 PM
oh
 
what repos should i clone/look at, just fsharp.viewmodule and fsxaml for now?
 
is it packaged any nice way or should i go through each page and save it?
 
I don't think it's packaged
 
9:24 PM
:)
 
Figured it'd be better to discuss all of the F# specific stuff here vs. WPF, etc :)
 
yes
I have a very buggy C# thing t worry about right now though
 
off topic @ReedCopsey, but should I be using strcpy_s in COM?
 
unlikely, as COM strings are typically not char*
they're BSTR types, so you'd need to use all of the functions that deal with BSTR, typically
 
well idk what these projects are then lol
LPCSTR maybe?
i'm headed out Reed, you should send me an e-mail with maybe an exercise I could do or/and two small tasks I could look at in the git repo :)
 

  last day (3525 days later) »