Comments (11)
I have no idea what I was doing with this (%log => static function? what?), and that makes me sad. Repurposing as logos improvement bug.
from logos.
What is the use case of %append
/%prepend
?
Also, just figure I'll put it here, find cool %ivar
syntax.
from logos.
Replace __PRETTY_FUNCTION__
with the corresponding hooked method name, to keep all the $$$ safe, not to mention clarity.
from logos.
%group X %init Y %end %end
might create _logos_class$_ungrouped$Y
.
from logos.
For the ivar syntax, would it be possible to simply declare them after a %subclass
directive? Like so
%subclass Foo : Bar
{
id _fooBar;
}
...
%end
Are there any limitations that prevent Logos from doing this, keeping all the leg work behind the scenes (like everything else it does ;P)?
from logos.
Main issue there is that I don't actually parse source. Syntel has a type parser, and it's possible at the very least to get into subclass blocks for ivars (ooh: treat them like syntelstructs! good idea!), but that would ideally be coupled with direct reference to ivar names. And that is dark magic indeed.
from logos.
Looked into __PRETTY_FUNCTION__
; it's handled as a primary-expression in the C parser. We can unfortunately not get inside it :(
from logos.
From #48.
17:22 <@DHowett> that should be being done anyway, come to think of
it. however, it complicates custom class expressions
17:22 <@DHowett> as init can wrap scope
17:22 <@DHowett> (the function cannot be variadic, and i do not know
what classes the user will want to change
17:22 <@DHowett> actually, that's tractable. i think it can be done)
17:23 <@DHowett> (the static function gets generated at the end, after
all. the call can contain all overridden classes)
17:23 <@DHowett> and the prototype and final function as well
from logos.
From #10.
The logs
config param for logos should exist, and support full
, off
, and on
(defaulting to on
). full
will automatically %log all hooked methods. off
will disable (consume) %log
directives.
from logos.
It should be possible to pass arbitrary expressions into a logos macro and have it dedupe and cache them.
Existing %c(classname)
expressions could be converted to use this functionality internally.
Additionally, components within theos itself could use this functionality to trim some of the work they perform (would use this for my internal generator)
Proposed syntax:
%cached(x)
yields a C rvalue that references the result of the computation x
as executed from inside %init;
(or the automatically generated initializer if none exists)
Potential extensions:
Nested cached expressions could be supported to eliminate duplicate work inside of cached expressions themselves. Further, cached expressions that are used only as a subexpression of other cached expressions could be optimized not to escape the scope of %init
Lazy initialization via alternate syntax (with/without thread safety?). Would allow syntax like this to workaround glacial apis:
%cached([[[NSCharacterSet characterSetWithCharactersInString:@"_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"] invertedSet] retain], lazy)
from logos.
Someone implemented %property in a pull request - #94
from logos.
Related Issues (20)
- Nullability specifiers not supported in %subclass methods
- Cannot find module ' ./logo.svg' or its corresponding type declarations. HOT 2
- Logos failes to hook NSBundle.bundleIdentifier on iOS 16 HOT 2
- Mixing `}` with `'` results in a false positive missing closure [Beeper] HOT 1
- Request: dot in class name support for %c HOT 4
- `super` in %subclass is dodgy HOT 1
- Nullability specifiers not supported in %property HOT 3
- Add [super ...] calls
- Logos compilation error if multiline comment has //
- Regression in %hookf HOT 4
- Issue when using %property to add NSMutableArray with specified item type HOT 2
- %property crashes when no parameters set HOT 8
- Line comments are incorrectly handled within block comments HOT 2
- Logos produces bad output without newline after imports HOT 1
- %config(generator=Internal) does not work but using `internal` does HOT 1
- [logos] preprocess could not handle comment outed braces correctly. HOT 2
- [Bug]: space/newline in %init causes issues HOT 1
- iOSOpenDev compiles with logos.pl in Xcode 14.1 RC2 with numerous deprecation warnings HOT 2
- Logos fails to parse code with curly braces inside of character literals
- Logos ignores end of block comment if line contains a `//` before block comment terminator HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logos.